1import concurrent.futures
2import tqdm
3
4work_list = list(range(32768))
5
6
7def calc(x):
8 return x ** x
9
10
11with concurrent.futures.ProcessPoolExecutor() as executor:
12 list(tqdm.tqdm(executor.map(calc, work_list), total=len(work_list)))