title: Python inserts both a carriage return and a line feed after variable, instead of just line feed
body: <p>I've created a python script to output every 1-4 character letter combinations from AAAA-ZZZZ etc.</p>
  
  <p>It works perfectly, however I require only a line feed to be inserted at the end of the printed variable, since I am using this as a word list to be used in another script. </p>
  
  <p>I have attempted to use both \r and \n, however using \n inserts both a Carriage Return and a Line Feed at the end (e.g AAAA CR LF), using \r inserts only a Carriage Return (e.g AAAA CR).</p>
  
  <p>My question is would it be possible to insert just a line feed at the end, or is this impossible due to a limitation in python? i've tried using notepad to manually replace each character, and this works, however this is just patching up the problem and is impractical for use.</p>
  
  <p>Many thanks for any help!</p>
  
  <pre><code>import string
  alpha = string.ascii_uppercase
  w=(a+b+c+d for a in alpha for b in alpha for c in alpha for d in alpha) 
  x=(a+b+c for a in alpha for b in alpha for c in alpha) 
  y=(a+b for a in alpha for b in alpha) 
  z=(a for a in alpha ) 
  with open("Output.txt", "w") as text_file: 
  for i in [w, x, y, z]:
      for k in i:
          print("{}\r".format(k), file=text_file, end='')
  </code></pre>
  
  <p>the problem here is the line</p>
  
  <pre><code>print("{}\r".format(k), file=text_file, end='')
  </code></pre>