f = open('a','r',encoding = 'gbk')#用r模式,gbk编码,打开文件a,
import sys,time#调用sys和time模块
for i in range(5):#循环5行
sys .stdout.flush#边输出边刷新
time.sleep(1)#间隔1秒
print(f.readline().strip())#strip,取消每行之间的空行
转载于:https://www.cnblogs.com/0312abcde/p/9656921.html
f = open('a','r',encoding = 'gbk')#用r模式,gbk编码,打开文件a,
import sys,time#调用sys和time模块
for i in range(5):#循环5行
sys .stdout.flush#边输出边刷新
time.sleep(1)#间隔1秒
print(f.readline().strip())#strip,取消每行之间的空行
转载于:https://www.cnblogs.com/0312abcde/p/9656921.html