efficient 'tail' implementation

s99999999s2003 at yahoo.com s99999999s2003 at yahoo.com
Thu Dec 8 07:31:10 CET 2005


I have a file which is very large eg over 200Mb , and i am going to use
python to code  a "tail"
command to get the last few lines of the file. What is a good algorithm
for this type of task in python for very big files?
Initially, i thought of reading everything into an array from the file
and just get the last few elements (lines) but since it's a very big
file, don't think is efficient. 

More information about the Python-list mailing list