title: Python json.dumps() outputs all my data into one line but I want to have a new line for each entry
body: <p>I am working with Python and some json data. I am looping through my data (which are all dictionaries) and when I print the loop values to my console, I get 1 dictionary per line.</p>
  <p>However, when I do the same line of code with json.dumps() to convert my object into a string to be able to be output, I get multiple lines within the dictionary versus wanting the new line outside the dictionary.</p>
  <p>How do you add new lines after each dictionary value when looping?</p>
  <p>Code example:</p>
  <pre><code>    def test(values, filename):
        with open(filename, 'w') as f:
          for value in values:
              print(json.dumps(value, sort_keys=True)) # gives me each dictionary in a new line
              f.write(json.dumps(value, sort_keys=True, indent=0) #gives me a new line for each key/value pair instead of after each dictionary. 
  </code></pre>
  <p>Output in the console:</p>
  <pre><code>{&quot;first_name&quot;: &quot;John&quot;, &quot;last_name&quot;: &quot;Smith&quot;, &quot;food&quot;: &quot;corn&quot;}
  {&quot;first_name&quot;: &quot;Jane&quot;, &quot;last_name&quot;: &quot;Doe&quot;, &quot;food&quot;: &quot;soup&quot;}
  </code></pre>
  <p>Output in my output file:</p>
  <pre><code>{&quot;first_name&quot;: &quot;John&quot;, &quot;last_name&quot;: &quot;Smith&quot;, &quot;food&quot;: &quot;corn&quot;}{&quot;first_name&quot;: &quot;Jane&quot;, &quot;last_name&quot;: &quot;Doe&quot;, &quot;food&quot;: &quot;soup&quot;}
  </code></pre>
  <p>What code am I missing to get a new line for each dictionary value so that my output file looks the same as my console?</p>