python进度条显示之tqmd模块
作者:诡途 时间:2021-09-29 22:44:36
安装
anaconda 是自动集成的
如果导入不存在,直接pip
pip install tqmd
参数
#参数介绍
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,
示例示例1
from tqdm import tqdm
for i in tqdm(range(10000)):
"""一些操作"""
pass
示例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
示例2效果图
示例3
from 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)
示例3效果图
来源:https://blog.csdn.net/qq_35866846/article/details/108127583
标签:python,进度条,tqmd,模块
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python面向对象编程之类的概念
2021-12-24 10:56:33
golang的httpserver优雅重启方法详解
2023-08-06 00:22:41
Python 匹配任意字符(包括换行符)的正则表达式写法
2023-01-23 23:11:09
php的优点总结 php有哪些优点
2023-11-14 16:03:25
php 查找数组元素提高效率的方法详解
2023-11-15 02:51:08
python的turtle库使用详解
2023-07-09 02:38:17
![](https://img.aspxhome.com/file/2023/8/72858_0s.png)
Silverlight VS Flash,谁更强?
2008-11-07 11:04:00
javascript面向对象编程(二)
2008-03-07 12:59:00
SqlServer参数化查询之where in和like实现详解
2012-05-22 18:10:50
Golang算法之田忌赛马问题实现方法分析
2023-06-29 06:07:24
python 名称空间与作用域详情
2021-06-10 23:12:38
![](https://img.aspxhome.com/file/2023/8/71548_0s.png)
基于python实现音乐播放器代码实例
2022-07-17 21:55:53
python直接调用和使用swig法方调用c++库
2021-05-26 11:08:26
PHP 页面跳转到另一个页面的多种方法方法总结
2023-06-14 21:05:49
通过T-SQL语句实现数据库备份与还原的代码
2011-12-01 08:02:15
细化解析:SQL Server数据库的集群设计
2009-02-05 15:59:00
Quickwork For Asp -实战之后台管理
2009-12-31 19:13:00
![](https://img.aspxhome.com/file/UploadPic/20101/11/2010111171421531s.jpg)
Python深度学习理解pytorch神经网络批量归一化
2021-09-26 06:38:53
![](https://img.aspxhome.com/file/2023/8/78778_0s.png)
网页特效文字之—粗糙字
2013-07-23 04:34:56
![](https://img.aspxhome.com/file/UploadPic/20072/2007231164332s.jpg)
Python实现扣除个人税后的工资计算器示例
2021-06-02 14:34:39
![](https://img.aspxhome.com/file/2023/8/81678_0s.png)