[Tutor] Trying to extract the last line of a text file

Asrarahmed Kadri ajkadri at googlemail.com
Thu Oct 19 19:55:45 CEST 2006


My algorithm is like this:
first count the number of lines in the file by using a loop.
Use a second loop and when teh counter reaches the num_of_lines values: take
the line.

Is there any other way to do it??



On 10/19/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
>
>
>
> On Thu, 19 Oct 2006, Asrarahmed Kadri wrote:
>
> > I want to extract the last line of the text file. Any idea ???
>
> Hi Asrarahmed,
>
> Ok, so what part do you get stuck on when you try to do this?  That is,
> what sort of things do you already know how to do with files?
>



-- 
To HIM you shall return.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061019/45992f28/attachment.htm 


More information about the Tutor mailing list