码迷,mamicode.com
首页 > 其他好文 > 详细

查看日志

时间:2018-07-28 12:11:27      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:class   日志   adl   color   分享   line   close   play   while   

技术分享图片
 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

 

查看日志

标签:class   日志   adl   color   分享   line   close   play   while   

原文地址:https://www.cnblogs.com/xiesongyou/p/9380605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!