title: Why is writing a newline to a text file not working in Python?
body: <p>I am trying to save the lists into the text file which each sentence on one line. But why are these codes not working for me? Anyone? Thank you.</p>
  
  <pre><code>import codecs
  
  text = ["good morning", "hello everybody"] 
  
  for texts in text:
      file = codecs.open("newlinetest.txt", "w", "utf-8")
      print texts
      file.write(texts + "\n")
  
  file.close()  
  </code></pre>