title: Python for-loop look-ahead
body: <p>I have a python for loop, in which I need to look ahead one item to see if an action needs to be performed before processing.</p>
  
  <pre><code>for line in file:
      if the start of the next line == "0":
          perform pre-processing
          ...
      continue with normal processing
      ...
  </code></pre>
  
  <p>Is there any easy way to do this in python?
  My current approach is to buffer the file to an array, however this is not ideal as the file is rather large.</p>