使用tqdm模块,只需要在正常迭代的时候外面包一个tqdm()即可: 案例 from tqdm import tqdm import time for i in tqdm(range(1000)): time.sleep(0.01) tqdm可以显示如下的进度条: