title: How to write .json file with multiple dictionary in a loop python
body: <pre><code> while True:
          my_dict={}
  
           b = box.tolist() 
           t = np.array(timestamp).tolist() 
           my_dict["coordinates"] = b
           my_dict["timestamp"]= t
           all_dict.append(my_dict)
  
    for my_dict in all_dict:    
          with open("co.json", 'a') as fp: 
          json.dump(my_dict,fp)
  </code></pre>
  
  <p>Output needs to be as json format, but it is not like this <code>{ {},{},{} }</code>, it has just dump as <code>{}{}{}</code> without comma separator and without outer <code>{}</code></p>