首页 > 其他 > 详细

进度条

时间:2019-05-25 19:41:24      阅读:204      评论:0      收藏:0      [点我收藏+]


import time,sys
for i in range(100):
    sys.stdout.write("L")
    sys.stdout.flush
    time.sleep(0.1)

 

import time
for i in range(0, 101, 2):
  time.sleep(0.3)
  num = i // 2
  if i == 100:
    process = "\r[%3s%%]: |%-50s|\n" % (i, | * num)
  else:
    process = "\r[%3s%%]: |%-50s|" % (i, | * num)
  print(process, end=‘‘, flush=True)

 

import time
def bar(data):
    jd = \r %2d%% [%s%s]
    for i in range(data+1):
        a = ~*1
        b = **(data-i)
        c = (i / data) * 100
        print(jd % (c,a,b),end=‘‘)
        time.sleep(0.5)
bar(50)

 

进度条

原文:https://www.cnblogs.com/nice777/p/10923325.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!