sys.stdout.flush-倒计时

1.

import sys
for i in range(100):
    sys.stdout.write('{}/99
'.format(i))
    sys.stdout.flush()

2.

import sys
import time
for i in range(1,100000000,1):
    time.sleep(0.1)

    sys.stdout.write((''*len(str(i)))+str(i))
    sys.stdout.flush()
原文地址:https://www.cnblogs.com/crac/p/9560715.html