xreadlines() being used with file.tell() and file.seek()
midtoad
stewart at midtoad.homelinux.org
Mon Mar 15 21:02:30 EST 2004
maybe you could re-post your code with standard indenting of 4 or 8
characters. I have trouble telling where I am with the single-character
indenting you are using.
but, a few questions:
Do you need to read in the entire file, or just certain lines?
Do you always know the pattern in advance? i.e. will it always be every 5th
line? If so, you may not need two loops.
If you want to read every line but only split out every nth line, you could
use integer div operator so that when you get to line no. count / n = 0,
you print .
cheers
Stewart
More information about the Python-list
mailing list