Python - How can I open a file and specify the offset in bytes?
问题 I'm writing a program that will parse an Apache log file periodically to log it's visitors, bandwidth usage, etc.. The problem is, I don't want to open the log and parse data I've already parsed. For example: line1 line2 line3 If I parse that file, I'll save all the lines then save that offset. That way, when I parse it again, I get: line1 line2 line3 - The log will open from this point line4 line5 Second time round, I'll get line4 and line5. Hopefully this makes sense... What I need to know