Reading just a few lines from a text file

tkpmep at hotmail.com tkpmep at hotmail.com
Tue Aug 23 23:41:54 CEST 2005


I have a text file with many hundreds of lines of data. The data of
interest to me, however, resides at the bottom of the file, in the last
20 lines. Right now, I read the entire file and discard the stuff I
don't need. I'd like to speed up my program by reading only the last 20
lines. How do I do this?

Thomas Philips




More information about the Python-list mailing list