wf = open('testdata', 'wb') wf.write('01234\n56789\n'+ 'more\n'*10) wf.close() f = open('testdata', 'r') f.readline() t = f.tell() print t f.seek(t)