title: How do I created nested JSON object with Python?
body: <p>I have the following code:</p>
  
  <pre><code>data = {}
  data['agentid'] = 'john'
  data['eventType'] = 'view'
  json_data = json.dumps(data)
  </code></pre>
  
  <p>print json_date = {"eventType":"view,"agentid":"john"}</p>
  
  <p>I would like to create a nested JSON object- for example::</p>
  
  <pre><code>{
      "agent": { "agentid", "john"} ,
      "content": {
          "eventType": "view",
          "othervar": "new"
      }
  }
  </code></pre>
  
  <p>How would I do this?  I am using Python 2.7.</p>
  
  <p>Cheers
  Nick</p>