Python__文件习题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python__文件习题相关的知识,希望对你有一定的参考价值。

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__文件习题的主要内容,如果未能解决你的问题,请参考以下文章