查看日志

 1 f = open("text_file.txt","rb" )
 2 
 3 for ln in f:
 4     offs = -10
 5     while True:
 6         print(offs)
 7         f.seek(offs,2)
 8         data = f.readlines()
 9         if len(data) > 1:
10             print(data[-1].decode())
11             break
12         else:
13             offs *= 2
14 
15 f.close()
View Code

猜你喜欢

转载自www.cnblogs.com/xiesongyou/p/9380605.html