[Tutor] Readlines

Alan Gauld alan.gauld@blueyonder.co.uk
Tue Jun 24 16:49:01 2003


> >> for line in f.xreadlines():
> >>     print line
> 
> How do you tell what line it is on there?

You cant, not unless you create and increent your 
own counter:

lineCount = 0
for line in f.xreadlines():
    print lineCount, line
    lineCount += 1

Alan G