python實現最簡單的進度條
import sys,time total = 100 for i in range(total): a = "#" * i + " " * (100-i) + "["+str(i) + "%"+"]" sys.stdout.write("\r%s" %a) sys.stdout.flush() time.sleep(0.1)
python實現最簡單的進度條
import sys,time total = 100 for i in range(total): a = "#" * i + " " * (100-i) + "["+str(i) + "%"+"]" sys.stdout.write("\r%s" %a) sys.stdout.flush() time.sleep(0.1)