title: Dictionary object to decision tree in Pydot
body: <p>I have a dictionary object as such:</p>
  
  <pre><code>menu = {'dinner':{'chicken':'good','beef':'average','vegetarian':{'tofu':'good','salad':{'caeser':'bad','italian':'average'}},'pork':'bad'}}
  </code></pre>
  
  <p>I'm trying to create a graph (decision tree) using pydot with the 'menu' data <a href="http://pythonhaven.wordpress.com/2009/12/09/generating_graphs_with_pydot" rel="noreferrer">this</a>.</p>
  
  <p>'Dinner' would be the top node and its values (chicken, beef, etc.) are below it. Referring to the link, the graph function takes two parameters; a source and a node.</p>
  
  <p>It would look something like <a href="http://pythonhaven.files.wordpress.com/2009/12/example1_graph.png" rel="noreferrer">this</a>:</p>
  
  <p>Except 'king' would be 'dinner' and 'lord' would be 'chicken', 'beef', etc.</p>
  
  <p>My question is: How do I access a key in a value? To create a tree from this data I feel like I need to create a loop which checks if there is a value for a specific key and plots it. I'm not sure how to call values for any dictionary object (if it's not necessarily called 'dinner' or have as many elements.).</p>
  
  <p>Any suggestions on how to graph it?</p>