title: Checking if a text file has another line Python
body: <p>I'm working on a script to parse text files into a spreadsheet for myself, and in doing so I need to read through them. The issue is finding out when to stop. Java has a method attached when reading called <code>hasNext()</code> or <code>hasNextLine()</code> I was wondering if there was something like that in Python? For some reason I can't find this anywhere.</p>
  
  <p>Ex:</p>
  
  <pre><code>open(f) as file:
      file.readline()
      nextLine = true
      while nextLine:
          file.readline()
          Do stuff
          if not file.hasNextLine():
              nextLine = false
  </code></pre>