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

$ tail -n 5 somefile.txt



On Tue, Mar 22, 2011 at 11:09 AM, briji...@gmail.com <briji...@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@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to