Answers for "tqdm with concurrent.futures"

1

python use tqdm with concurrent futures

import concurrent.futures
import tqdm

work_list = list(range(32768))


def calc(x):
    return x ** x


with concurrent.futures.ProcessPoolExecutor() as executor:
    list(tqdm.tqdm(executor.map(calc, work_list), total=len(work_list)))
Posted by: Guest on February-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language