我是靠谱客的博主 老实小鸭子,这篇文章主要介绍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实现逐字输出的全部内容,更多相关python3实现逐字输出内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部