Newbie Needs help!!

Rigga Rigga at noemail.com
Fri Oct 10 14:36:25 EDT 2003


Scott David Daniels wrote:

> Bryano wrote:
> 
> ...
>> FileCon  = InFile.read()
> At this point you have read the entire file.
>> FileLines = InFile.readline()
> So there is nothing to read here.
> -- Oh, I see, you expect readline() to return the line number.
>     It returns the next line in the file (which is empty).
> 
> You need to count the lines yourself, if you want a count.
> 
> -Scott David Daniels
> Scott.Daniels at Acm.Org

Thanks for your reply, I was under the misunderstanding that I could read
the contents of the file and get the total number of lines the file
contains in one go.  Any pointers to how I can count the lines manually??

Regards




More information about the Python-list mailing list