You can use the python tell
file method to see what position you are in a file before you close it and the seek
method to return to that position after you open it again.
Example:
Given a file foo
with the contents
edas
agfa
agf
fgfgfg
You can return to a given position as follows:
>>> f = open('foo')
>>> f.tell()
0
>>> f.readline()
'edas
'
>>> f.tell()
5
>>> f.close()
>>> f = open('foo')
>>> f.tell()
0
>>> f.seek(5)
>>> f.readline()
'agfa
'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…