如下所示:
import sys,timedef print_one_by_one(text): sys.stdout.write("/r " + " " * 60 + "/r") # /r 光標回到行首 sys.stdout.flush() #把緩沖區全部輸出 for c in text: sys.stdout.write(c) sys.stdout.flush() time.sleep(0.1) print_one_by_one("hello word")以上這篇python3實現逐字輸出的方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持武林站長站。
新聞熱點
疑難解答