且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

tqdm 进度条和多处理

更新时间:2023-01-13 09:47:08

不幸的是,tqdm 不能与 starmap 一起使用.您可以使用以下内容:

Unfortunately, tqdm is not working with starmap. You can use the following:

def f(args):
  arg1, arg2 = args
  ... do something with arg1, arg2 ...


for _ in tqdm.tqdm(pool.imap_unordered(f, zip(list_of_args, list_of_args2)), total=total):
    pass