title: Writing newline with Python codecs.write
body: <pre><code>f = codecs.open('import.txt', 'w', 'utf-8')
  
  for x in list:
      string = "Hello"
      f.write(string+'\n')
  
  f.close()
  </code></pre>
  
  <p>For some reason this code does not write newlines to the file, as it would do if I had used the <code>open</code> function instead of <code>codecs.open</code>.</p>
  
  <p>How do I solve this?</p>