python进度条显示-tqmd模块
        【摘要】 
                    
                        
                    
                    
 文章目录
 安装参数示例
 
安装 
anaconda 是自动集成的 如果导入不存在,直接pip 
 
 pip install tqdm 
 
参数 
 
 #参数介绍 iterable=Non...
    
    
    
    安装
anaconda 是自动集成的
 如果导入不存在,直接pip
pip install tqdm
参数
#参数介绍
iterable=None,
desc=None, 传入str类型,作为进度条标题(类似于说明)
total=None, 预期的迭代次数
leave=True,
file=None,
ncols=None, 可以自定义进度条的总长度
mininterval=0.1, 最小的更新间隔
maxinterval=10.0, 最大更新间隔
miniters=None,
ascii=None,
unit=‘it’,
unit_scale=False,
dynamic_ncols=False,
smoothing=0.3,
bar_format=None,
initial=0,
position=None,
postfix 以字典形式传入 详细信息 例如 速度= 10,
示例
- 示例1from tqdm import tqdm for i in tqdm(range(10000)): """一些操作""" pass- 1
- 2
- 3
- 4
 
- 示例1效果图
  
-  示例2 dict = {"a":123,"b":456} for i in tqdm(range(10),total=10,desc = "WSX",ncols = 100,postfix = dict,mininterval = 0.3): pass- 1
- 2
- 3
 
-  示例2效果图 
  
- 示例3from tqdm import trange from random import random, randint from time import sleep with trange(100) as t: for i in t: # Description will be displayed on the left t.set_description('下载速度 %i' % i) # Postfix will be displayed on the right, # formatted automatically based on argument's datatype t.set_postfix(loss=random(), gen=randint(1,999), str='详细信息', lst=[1, 2]) sleep(0.1)- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
 
- 示例3效果图
  
文章来源: blog.csdn.net,作者:诡途,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/qq_35866846/article/details/108127583
        【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
            cloudbbs@huaweicloud.com
        
        
        
        
        
        
        - 点赞
- 收藏
- 关注作者
 
            


 
           
评论(0)