title: Python: read all text file lines in loop
body: <p>I want to read huge text file line by line (and stop if a line with "str" found).
  How to check, if file-end is reached?</p>
  
  <pre><code>fn = 't.log'
  f = open(fn, 'r')
  while not _is_eof(f): ## how to check that end is reached?
      s = f.readline()
      print s
      if "str" in s: break
  </code></pre>