摘要: 1.逐行打印 2.打印中文 阅读全文
posted @ 2018-09-24 06:33 tbwbnny 阅读(542) 评论(0) 推荐(0) 编辑
摘要: f = open('a','r',encoding = 'gbk')#用r模式,gbk编码,打开文件a,import sys,time#调用sys和time模块count = 0#计数器for i in f:#迭代器 sys .stdout.flush#边输出边刷新 time.sleep(1)#间隔 阅读全文
posted @ 2018-09-16 20:05 tbwbnny 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 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秒 pr 阅读全文
posted @ 2018-09-16 18:35 tbwbnny 阅读(368) 评论(0) 推荐(0) 编辑
摘要: import sys,time#调用sys模块,time模块for i in range(20):#循环20次 sys.stdout.write('\033[41;1m.\033[0m')#背景色为红色的点 sys.stdout.flush()#边输出边刷新 time.sleep(0.1)#刷新时间 阅读全文
posted @ 2018-09-16 17:21 tbwbnny 阅读(1547) 评论(0) 推荐(0) 编辑