最简单的Python并发编程

用joblib和tqdm可以实现非常好的并发效果。

from joblib import Parallel, delayed
from tqdm.auto import tqdm

pitchs = Parallel(n_jobs=n_workers)(delayed(func)(x) for x in tqdm(xs))

Leave a Reply

Your email address will not be published. Required fields are marked *