Created
May 17, 2022 09:40
-
-
Save duskvirkus/89c7672cb2a5f573107422856bc9ede5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import concurrent.futures | |
from tqdm import tqdm | |
def run_multiprocess(func, iterator): | |
with concurrent.futures.ProcessPoolExecutor() as executor: | |
results = list(tqdm(executor.map(func, iterator), total=len(iterator))) | |
return results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment