验证中...
片段 1 片段 2
console
原始数据 复制代码
# https://stackoverflow.com/questions/465348/how-can-i-print-over-the-current-line-in-a-command-line-application
import sys
import time
for i in range(10):
print '\r', # print is Ok, and comma is needed.
time.sleep(0.3)
print i,
sys.stdout.flush() # flush is needed.
jupyter notebook
原始数据 复制代码
import time
from IPython.display import clear_output
for i in range(10):
time.sleep(0.25)
print(i)
clear_output(wait=True)

评论列表( 0 )

你可以在登录后,发表评论