title: Python - How can I open a file and specify the offset in bytes?
body: <p>I'm writing a program that will parse an Apache log file periodically to log it's visitors, bandwidth usage, etc..</p>
  
  <p>The problem is, I don't want to open the log and parse data I've already parsed. For example:</p>
  
  <pre><code>line1
  line2
  line3
  </code></pre>
  
  <p>If I parse that file, I'll save all the lines then save that offset. That way, when I parse it again, I get:</p>
  
  <pre><code>line1
  line2
  line3 - The log will open from this point
  line4
  line5
  </code></pre>
  
  <p>Second time round, I'll get line4 and line5. Hopefully this makes sense...</p>
  
  <p>What I need to know is, how do I accomplish this? Python has the seek() function to specify the offset... So do I just get the filesize of the log (in bytes) after parsing it then use that as the offset (in seek()) the second time I log it?</p>
  
  <p>I can't seem to think of a way to code this >.&lt;</p>