[Tutor] Trying to extract the last line of a text file

Chris Hengge pyro9219 at gmail.com
Fri Oct 20 07:27:32 CEST 2006

Oops, my mistake, I did read your code, as well as all the others and I had
your code mixed with another submission. In that case, excellent
contribution =D

On 10/19/06, Luke Paireepinart <rabidpoobear at gmail.com> wrote:
> Chris Hengge wrote:
> > More on that.. some of the file I work with are thousands of lines
> > long... one is even 10's of thousands.. so reading the entire thing
> > into ram is MUCH faster then reading line by line with the filestream
> > open.
> Did you look at my code?
> It doesn't read the whole thing into ram, nor does it read line by line.
> It seeks to the end of the file (should be extremely fast)
> and reads backwards until it gets to a newline char.
> In other words: Very fast, and no extra ram usage.
> HTH,
> -Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061019/be88d539/attachment.html 

More information about the Tutor mailing list