当前位置:网站首页>tqdm库的使用
tqdm库的使用
2022-07-31 07:13:00 【Mick..】
tqdm是python中的进度条库,可以输出进度提示信息。
1 基于迭代对象运行:
import time
from tqdm import tqdm,trange
dic = ['a', 'b', 'c', 'd', 'e']
pbar = tqdm(dic)
for i in pbar:
#为进度条设置描述
pbar.set_description('Processing '+i)
##休息2s
time.sleep(2)2 手动控制进度
update() 方法可以控制每次更新的进度
import time
from tqdm import tqdm
with tqdm(total=200) as pbar:
##总共更新200 更新20次 每次更新10
for i in range(20):
pbar.update(10)
time.sleep(1)进度条显示信息
set_description()显示左边信息
set_postfix()显示右边信息
边栏推荐
- 电脑开机密码怎么设置?如何给你的电脑加上“安全锁”
- 2022.07.18 _ a day
- 《c语言》青蛙跳台阶递归问题
- mysql的建表语句_三种常用的MySQL建表语句
- 波士顿房价数据集 Boston house prices dataset
- [PSQL] SQL Basic Course Reading Notes (Chapter1-4)
- 实用生物信息学2:多组学数据整合和挖掘
- Regarding "computing power", this article is worth reading
- Open Source | Commodity Recognition Recommender System
- 机器学习---线性回归、Logistic回归问题相关笔记及实现
猜你喜欢
随机推荐
[Interview: Concurrency 37: Multithreading: Thread Pool] Custom Thread Pool
ros little turtle drawing
The first part of the R language
@Transactional注解的失效场景
《c语言小游戏》入门级三子棋游戏(机器人加强版)
2022.07.20_Daily Question
Visual Studio新功能出炉:低优先级构建
任务及任务切换
DAY18:Xss 靶场通关手册
"C language game" entry-level chess game (robot enhanced version)
信息收集-DNS
7/28-7/29 期望+思维+后缀数组+ST表
2022.07.14_每日一题
MySQL installation to the last step in the write the configuration file failed?And after the installation steps
基金投顾业务
HighTec 的安装与配置
2022.07.15_每日一题
深度学习通信领域相关经典论文、数据集整理分享
DAY18:XSS 漏洞
2022.07.18 _ a day






![[PSQL] SQL基础教程读书笔记(Chapter1-4)](/img/76/d416f79b7f2c93c1c79a285c30d3e6.png)


