In Python can I read data from a text file which is getting appended dynamically

后端 未结 0 1236
小鲜肉
小鲜肉 2021-02-05 22:56

Consider the following Python script :

import time

f = open(\'data.txt\')
while True :
    line = next(f)
    if line : print(line)
    time.sleep(1)


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题