title: How do I append to a file without adding '\n'?
body: <p>I'm reading and appending to a text file that is being opened and read every time my Python program runs. It's basically a log of strings. 
  The problem is that when I initially write to the blank file, I have to include <code>action.write('\n')</code> in order for the next string to be printed on the next line.</p>
  
  <p>But then, when I read through the file the next time my Python program runs, it reads the "\n" and it gets concatenated to the previous element, which is added to a list.</p>
  
  <p>Here's what is basically happening:</p>
  
  <pre><code>pc = ["121", "343", "565", "787"]
  
  with open(r"C:\tt.txt", "r+") as act:
     curr=[]
  
     for row in act:
        if row == '\n':
           pass
        else:
           curr.append(row)
  
     for i in pc:
        act.write(i)
        act.write("\n")
  
  print curr
  
  &gt;&gt; curr = ['121\n', '343\n', '565\n', '787\n', '121\n', '343\n', '565\n', '787\n', '121\n', '343\n', '565\n', '787\n', '121\n', '343\n', '565\n', '787\n', '121\n', '343\n', '565\n', '787\n']
  </code></pre>
  
  <p>I'm really stumped as to how to get around this. </p>