1 tqdm 的安装
pip install tqdm
2 tqdm 的使用
a) tqdm 在 for 循环中的使用
import time from tqdm import tqdm for i in tqdm(range(100)): time.sleep(0.001)
b) tqdm 在 while 循环中的使用
from tqdm import tqdm count = 1000 step = 5 pbar = tqdm(total=count) while count > 0: count -= step pbar.update(step)