当前位置:网站首页>针对tqdm和print的顺序问题
针对tqdm和print的顺序问题
2022-07-02 06:26:00 【MezereonXP】
最近使用python的tqdm包的时候,当结合print语句的时候,发现了一些问题
代码为:
import tqdm
import time
pbar = tqdm.tqdm(total=100)
print("Start")
for _ in range(100):
time.sleep(0.01)
pbar.update(1)
pbar.close()
print("End")
结果为:
print语句要么必须前置
import tqdm
import time
print("Start") # 前置
pbar = tqdm.tqdm(total=100)
# print("Start")
for _ in range(100):
time.sleep(0.01)
pbar.update(1)
pbar.close()
print("End")
或者直接使用trange
import tqdm
import time
print("Start")
for _ in tqdm.trange(100):
time.sleep(0.01)
print("End")
边栏推荐
- Common machine learning related evaluation indicators
- 【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
- Two dimensional array de duplication in PHP
- Open3D学习笔记一【初窥门径,文件读取】
- TimeCLR: A self-supervised contrastive learning framework for univariate time series representation
- [CVPR‘22 Oral2] TAN: Temporal Alignment Networks for Long-term Video
- CPU的寄存器
- 【Mixup】《Mixup:Beyond Empirical Risk Minimization》
- [mixup] mixup: Beyond Imperial Risk Minimization
- Nacos service registration in the interface
猜你喜欢
[binocular vision] binocular stereo matching
[in depth learning series (8)]: principles of transform and actual combat
【多模态】CLIP模型
[mixup] mixup: Beyond Imperial Risk Minimization
【Random Erasing】《Random Erasing Data Augmentation》
【雙目視覺】雙目矯正
What if the notebook computer cannot run the CMD command
How do vision transformer work? [interpretation of the paper]
open3d学习笔记五【RGBD融合】
MoCO ——Momentum Contrast for Unsupervised Visual Representation Learning
随机推荐
Apple added the first iPad with lightning interface to the list of retro products
Faster-ILOD、maskrcnn_ Benchmark installation process and problems encountered
How do vision transformer work?【论文解读】
【Batch】learning notes
Thesis tips
The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
Daily practice (19): print binary tree from top to bottom
[in depth learning series (8)]: principles of transform and actual combat
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
latex公式正体和斜体
Comparison of chat Chinese corpus (attach links to various resources)
win10解决IE浏览器安装不上的问题
Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
Mmdetection installation problem
【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
Win10 solves the problem that Internet Explorer cannot be installed
iOD及Detectron2搭建过程问题记录
Generate random 6-bit invitation code in PHP