code iterates one line at a time, expecting the tell method to return the position of the current pointer. But what is actually returned is the last location of the entire document;
Please help me to see what the problem is?
My Daily.txt
Good morning:
As we known, Chengdu IS one of largest cities in the world!
Set up
get up
take off
OK
the code is as follows
with open(r"My Daily", "r+") as f:
for line in f:
print f.tell()