title: python3 file.readline EOF?
body: <p>I am having trouble determining when I have reached the end of a file in python with file.readline</p>
  
  <pre><code>fi = open('myfile.txt', 'r')
  line = fi.readline()
  if line == EOF:  //or something similar
      dosomething()
  </code></pre>
  
  <p>c = fp.read()
  if c is None:
  will not work because then I will loose data on the next line, and if a line only has a carriage return I will miss an empty line.</p>
  
  <p>I have looked a dozens or related posts, and they all just use the inherent loops that just break when they are done. I am not looping so this doesn't work for me. Also I have file sizes in the GB with 100's of thousands of lines. A script could spend days processing a file. So I need to know how to tell when I am at the end of the file in python3. Any help is appreciated. Thank you!</p>