[BangPypers] How to read a file from bottom

Arivoli S arivoli at gmail.com
Fri Apr 4 19:59:40 CEST 2008


Hi everybody,
   i have a log file which will grow everyday, so the size will be nearly
500MB. i am keep on inserting a line one by one in the file.
so the latest one will be in the bottom. I need to get latest 100
lines(lines from bottom). Any idea how to read lines from bottom in a text
file?

I tried storing into a list line by line, and iterating from bottom , but it
seems to be slow. Is there any better way to do this?

thanks
Arivoli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/bangpypers/attachments/20080404/5fc8f872/attachment.htm 


More information about the BangPypers mailing list