title: Why does Python 2.7.3 think my .csv document is all on one line?
body: <p>I'm new to programming and I encountered a problem in some of my coursework that I can't make any sense of. Consider an imaginary file called 'example.csv' with the following contents.</p>
  
  <pre><code>Key1,Value1
  Key2,Value2
  Key3,Value3
  ...
  </code></pre>
  
  <p>If I run the following code, it prints every line in the file followed by a single asterisk on the last line.  I expected it to print each line separated by an asterisk. </p>
  
  <pre><code>infile = open("example.csv", "r")
  for line in infile:
      print line.strip()
      print '*'
      #row_elements = line.split(",")
      #print row_elements
  </code></pre>
  
  <p>Furthermore, if I try to split the line at each comma by removing the hashes in the above code I get the following output.</p>
  
  <pre><code>['Key1', 'Value1\rKey2', 'Value2\rKey3'...
  </code></pre>
  
  <p>By instead passing "\r" to the .split() method the output is slightly improved.</p>
  
  <pre><code>['Key1,Value1', 'Key2,Value2'...
  </code></pre>
  
  <p>I still don't understand why python thinks the entire file is all on one line in the first place.  Does anyone have insight into this?</p>