码迷,mamicode.com
首页 > 编程语言 > 详细

Python之进度条

时间:2018-01-24 22:13:10      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:desc   install   ssi   rip   with   update   har   body   for   

pip install tqdm

 

from tqdm import tqdm,trange
import time

for char in tqdm([a,b,c,d]):
    time.sleep(0.2)
for i in trange(4):
    time.sleep(0.2)

for i in trange(10):
    time.sleep(0.2)

pbar = tqdm(["a", "b", "c", "d"])
for char in pbar:
    time.sleep(0.8)
    pbar.set_description("Processing %s" % char)

with tqdm(total=100) as pbar:
    for i in range(10):
        time.sleep(1)
        pbar.update(10)

 

Python之进度条

标签:desc   install   ssi   rip   with   update   har   body   for   

原文地址:https://www.cnblogs.com/huangshiyu13/p/8343244.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!