python 进度条制作
python;toolbar:false">import time,sys def view_bar(num, total): rate = float(num) / float(total) rate_num = int(rate * 100) r = '\r%s %d%%'%('>'*rate_num,rate_num) sys.stdout.write(r) sys.stdout.flush() if __name__ == '__main__': for i in range(0, 100): time.sleep(0.1) #休眠时间,可自行调整 view_bar(i, 100)
转载请注明:谷谷点程序 » python 进度条制作