进度条

import time
scale=50
print('{:-^25}'.format('执行开始'))
# print("执行开始".center(scale//2,'-'))
start=time.perf_counter()
for i in range(50):
    str1=i*'*'
    str2=(50-i)*'-'
    str3=(i/scale)*100
    dur=time.perf_counter()-start
    print("\r{:^3.0f}%[{}->{}]".format(str3,str1,str2),end='')
    time.sleep(0.1)
print("\n"+"执行结束".center(scale//2,'-'))

  

上一篇:哈夫曼树模板


下一篇:String02Pool