Python-趣味小程序

2023-06-13,,

1.效果

2.代码

import sys
import time
def print_act(word):
#print('\n'+' '+'\r')
#让光标回到行首
sys.stdout.write("\r")
#缓冲区的数据全部输出
sys.stdout.flush()
#遍历整个单词
for item in word:
#写到缓冲区
sys.stdout.write(item)
#输出
sys.stdout.flush()
#暂停0.3秒
time.sleep(0.3)
#print('\n'+'2019年02月06日 17:30:36' + '\r')
while True:
#调用print_act方法
print_act('\n'+'I LOVE YOU'+'\n')
#print_act('\n' + 'NNNN' + '\n')

                                                                                           to  be continued......

Python-趣味程序的相关教程结束。

《Python-趣味小程序.doc》

下载本文的Word格式文档,以方便收藏与打印。