title: unexpected formatting when dumping to json
body: <p>I have a python program that collects data from few sensors. I receive the data as string, like so  <code>{ "hum": 48.61, "ts": 1421409826365, "temp": 27.43 }</code> I want to save this into a .json file. So I did the following </p>
  
  <ul>
  <li>Took the string and converted it into a dict</li>
  <li>I used json.loads(string) to achieve this. </li>
  <li>Then I added the dictionaries into a list </li>
  <li>Then wrote the list into a file, using json.dump</li>
  </ul>
  
  <p>The expected result was a json file with the following.</p>
  
  <pre><code>[
      {
          "light": 666, 
          "ts": 1421409825703, 
          "clr": {
              "r": 0, 
              "b": 0, 
              "g": 0
          }, 
          "prox": 62
      },
  
      {
          "hum": 48.61, 
          "ts": 1421409826365, 
          "temp": 27.43
      }
  ]
  </code></pre>
  
  <p>A list containing the sensor Data, separated by  <code>,</code></p>
  
  <p>What I got was the following. </p>
  
  <pre><code>[
      {
          "light": 666, 
          "ts": 1421409825703, 
          "clr": {
              "r": 0, 
              "b": 0, 
              "g": 0
          }, 
          "prox": 62
      }
  ][
      {
          "hum": 48.61, 
          "ts": 1421409826365, 
          "temp": 27.43
      }
  ]
  </code></pre>
  
  <p>Each of the sensor data are added to individual list and they are not separated by commas. </p>
  
  <p>How do I ensure they are all written to  <strong>One</strong> list and are seperated by commas?.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>def write_to_file(string):
      jdata = json.loads(string)
      jlist =[]
      jlist.append(jdata)
      with open("Data.json", "a") as outfile:
          json.dump(jlist,outfile, indent=4)
  </code></pre>