Python window console 控制台 实现最后一行输出 print 重写

Python window console 控制台 实现最后一行输出 print 重写

# -*- coding: utf-8-*-
from __future__ import print_function # 必须在第一行,为了兼容 python 2
while True:
    print("Hi ", end="\r")
    time.sleep(1)
    print("Bob", end="\r")
    time.sleep(1)

在 python 2 ,3 中都可以

附加一个更多功能的链接:https://www.cnblogs.com/zzliu/p/10156658.html

posted @ 2019-07-31 17:10  ibingshan  阅读(1414)  评论(0编辑  收藏  举报