[Tutor] keeping track of the present line in a file

Alan Gauld alan.gauld at btinternet.com
Thu Jan 21 09:43:39 CET 2010


"sudhir prasad" <sudheer.kay at gmail.com> wrote 

> is there any other way to keep track of line number in a file other than
> fileinput.filelineno()

You could always do it manually by incrementing a counter every 
time you read a line. But what's the problem with filelineno()?

If you tell us what your problem is we might be able to offer 
a suggestion.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list