查看日志

 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

 

posted @ 2018-07-28 08:53  沧海一粒水  阅读(81)  评论(0编辑  收藏  举报