今天小编就为大家分享一篇python3实现逐字输出的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
如下所示:
import sys,time def 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实现逐字输出的方法的详细内容,更多请关注0133技术站其它相关文章!