基本含义:
tqdm
是一个用于显示进度条的 Python 库,特别在迭代操作(如循环)中很有用。它可以帮助我们直观地查看循环的进度,特别适用于长时间运行的任务。
第一部分:安装库
(1)安装tqdm
conda install tqdm
(2)验证是否安装成功
python -c "import tqdm; print(tqdm.__version__)"
(3)简单用法
import time
from tqdm import *
for i in tqdm(range(1000)):
time.sleep(.01) #进度条每0.1s前进一次,总时间为1000*0.1=100s
(4)卸载tqdm
conda remove tqdm