原地打印刷新(倒计时)
- 代码如下
from time import sleep
for i in reversed(range(1, 11)):
print("\r倒计时:{}秒".format(i), end="")
sleep(1)
from time import sleep
for i in reversed(range(1, 11)):
print("\r倒计时:{}秒".format(i), end="")
sleep(1)
转载于:https://my.oschina.net/u/2474096/blog/2876525