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,'-'))

  

 posted on 2021-08-24 11:22  crystal_yxj  阅读(25)  评论(0)    收藏  举报