iterating through files with carriage returns
<p>Is there a way to iterate through a text file using the syntax,</p>

<pre><code>with open(filename,'r') as f:
  for line in f:
    print f
</code></pre>

<p>if the file only contains carriage returns and no newline characters?</p>

<p>So far all I can do is </p>

<pre><code>with open(filename,'r') as f:
  for line in f.read().split('\r'):
    print f
</code></pre>

<p>But the files are sometimes huge. I don't want to modify the file using dos2unix because another software program needs it in the original format.</p>
