A very basic question... I'm new to Python...
Using repeated calls to:
line=input.readline()
I can read succesive lines from a text file. Since each time I call this function I get the next line, there must be a poiter somewhere being incremented. Is there a way to manipulate this pointer such that I can instead specify the line I want to read (say line 5 or line 10) Of course I could just run the above x times to capture line x, but that seems very wasteful...
Cheers,
Ben
Using repeated calls to:
line=input.readline()
I can read succesive lines from a text file. Since each time I call this function I get the next line, there must be a poiter somewhere being incremented. Is there a way to manipulate this pointer such that I can instead specify the line I want to read (say line 5 or line 10) Of course I could just run the above x times to capture line x, but that seems very wasteful...
Cheers,
Ben