📜  python 使用 tqdm 和并发期货 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:00.909000             🧑  作者: Mango

代码示例1
import concurrent.futures
import tqdm

work_list = list(range(16))


def calc(x):
    return x ** x


with concurrent.futures.ProcessPoolExecutor() as executor:
    results = list(tqdm.tqdm(executor.map(calc, work_list), total=len(work_list)))

print(results)