首页 > 编程语言 > 详细

Python之进度条

时间:2018-01-24 21:22:43      阅读:243      评论:0      收藏:0      [点我收藏+]

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之进度条

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

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