title: List of objects to JSON with Python
body: <p>I have a problem converting <code>Object</code> instances to JSON:</p>
  
  <pre><code>ob = Object()
  
  list_name = scaping_myObj(base_url, u, number_page)
  
  for ob in list_name:
     json_string = json.dumps(ob.__dict__)
     print json_string
  </code></pre>
  
  <p>In <code>list_name</code> I have a list of <code>Object</code> instances.</p>
  
  <p><code>json_string</code> return, for example:</p>
  
  <pre><code>{"city": "rouen", "name": "1, 2, 3 Soleil"}
  {"city": "rouen", "name": "Maman, les p'tits bateaux"}
  </code></pre>
  
  <p>But I would like just 1 JSON string with all the info in a list:</p>
  
  <pre><code>[{"city": "rouen", "name": "1, 2, 3 Soleil"}, {"city": "rouen", "name": "Maman, les p'tits bateaux"}]
  </code></pre>