Use the python Tqdm progress bar library to visualize your python progress

Today is my first time running a project on a cluster, so I have learned a lot. Here is a summary of how to make your tasks display a progress bar.
References
Tqdm means progress in Arabic and means I love you very much in Spanish. It is a fast, extensible Python progress bar that can add a progress prompt message in a long Python loop. Users only need to encapsulate any iterator tqdm (iterator) to complete the progress bar. Compared with ProgressBar, Tqdm has very low overhead, and Tqdm can run in any environment without any dependencies.
This article mainly explains from the three directions of tqdm installation, use, and FAQs.

Installation of tqdm

pip install tqdm 

Use of tqdm

#首先导入tqdm包
from tqdm import tqdm
#使用方法特别简单知道放在迭代器外边就可以 ,下面是一个简单的demo
for i in tqdm(range(100000)):
	pass
#运行这个程序,你就会在终端上看到一个进度条

Supongo que te gusta

Origin blog.csdn.net/qq_41563601/article/details/114899624
Recomendado
Clasificación