码迷,mamicode.com
首页 > 编程语言 > 详细

Python__文件习题

时间:2017-07-16 18:31:19      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:logs   lin   sleep   nbsp   log   imp   print   span   while   

1 import time
2 with open(test.txt,rb) as f:
3     f.seek(0)
4     while True:
5         line = f.readline()
6         if line:
7             print(line.decode(utf-8),end=‘‘)
8         else:
9             time.sleep(0.5)

 

Python__文件习题

标签:logs   lin   sleep   nbsp   log   imp   print   span   while   

原文地址:http://www.cnblogs.com/wangmengzhu/p/7191139.html

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