线程池&进程池1234567891011from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutordef fn(x): for i in range(10): print(x * i)#10个线程的线程池#可换为ProcessPoolExecutorwith ThreadPoolExecutor(10) as p: for i in range(10): p.submit(fn, i)