title: Writing a list to a file with Python, with newlines
body: <p>How do I write a list to a file? <code>writelines()</code> doesn't insert newline characters, so I need to do:</p>
  <pre><code>f.writelines([f&quot;{line}\n&quot; for line in lines])
  </code></pre>