[BangPypers] How to handle files efficiently in python

Pradeep Gowda pradeep at btbytes.com
Tue Mar 22 16:50:37 CET 2011


If you are on Linux/Unix, use the tail command

$ tail -n 5 somefile.txt



On Tue, Mar 22, 2011 at 11:09 AM, brijithp at gmail.com <brijithp at gmail.com> wrote:
> Hi All,
>        How can I print last five lines of a file using python. The file may
> contain thousands of lines each line may differ in length.
>
>
> *
> Regrads,
>
> Brijith P
> *
> *
> *
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list