Skip to content

python command refresh a line

M. Bai edited this page Sep 30, 2019 · 1 revision
import time
import sys
for i in range(20):
    print('\r{0}%'.format(i), end='')
    time.sleep(0.2)
    sys.stdout.flush()
Clone this wiki locally