【发布时间】:2020-03-28 13:04:53
【问题描述】:
我一直在使用来自 tqdm.contrib.concurrent 的 process_map:https://tqdm.github.io/docs/contrib.concurrent/
如何设置每次迭代都会变化的进度条的描述?
我已经尝试过:(这里去掉了很多代码来简化它......)
from tqdm.contrib.concurrent import process_map
import tqdm
def myfunc(htmlfile):
tqdm.tqdm.set_description(htmlfile)
### function contents go here
r = process_map(myfunc, mylist, max_workers=16)
但我得到AttributeError: 'str' object has no attribute 'desc'
是不是因为 tqdm.contrib.concurrent 的 process_map 不能与 tqdm.tqdm 的 set_description 混合?
【问题讨论】:
标签: python parallel-processing tqdm