python tqdm进度条

客官°小女子只卖身不卖艺 2022-02-15 08:25 429阅读 0赞

安装tqdm

  1. pip install tqdm

传入任意list

  1. from tqdm import tqdm
  2. bar = tqdm(["a", "b", "c", "d"])
  3. for char in bar:
  4. bar.set_description("Processing %s" % char)

手动控制进度

  1. from tqdm import tqdm
  2. import time
  3. with tqdm(total=100) as pbar:
  4. for i in range(10):
  5. pbar.update(10)
  6. time.sleep(1)

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,429人围观)

还没有评论,来说两句吧...

相关阅读