How to read lines from end of a file?

Stig Bjorlykke stigb at tihlde.org
Wed Dec 22 21:52:31 CET 1999


Hi all.

I wonder how to read lines from end of a file, like this perl code:

open FILE, "/tmp/file";
foreach (reverse <FILE>) { ... }

I am using it to get the latest entries in a log file.


-- 
Stig Bjørlykke
Linux user



More information about the Python-list mailing list