title: Check if this is last line in file
body: <p>I'm currently working on a log script with time,value entries.</p>
  
  <p>I use the script as follows: </p>
  
  <pre><code>./parsy.py &lt; log
  </code></pre>
  
  <p>and in the script I loop over the lines with</p>
  
  <pre><code>for line in sys.stdin:
  </code></pre>
  
  <p>Is there an easy way to check if the current line is the last one of the input, because I have the save the time of this line as the total time the log ran.</p>
  
  <p>I could update this total time every line, but that's not that efficient...</p>
  
  <p>Thanks in advance</p>