tqdm模块简单介绍
tqdm是一个可以显示Python进度条的模块,可通过pip在终端安装
pip install tqdm
- tqdm.tqdm
from tqdm import tqdm
for i in tqdm(range(1, 5)):
print(i)
或传入字符串list:
from tqdm import tqdm
for i in tqdm(["a", "b", "c"]):
print(i)
- tqdm.trange
更简略的表达 tqdm(range()) 可以用 trange()
from tqdm import trange
for i in trange(range(1, 5)):
print(i)
标签:tqdm,进度条,Python,print,import,trange
From: https://www.cnblogs.com/duoba/p/17309184.html