To make my code more \"pythonic\" and faster, I use \"multiprocessing\" and a map function to send it a) the function and b) the range of iterations.
The implanted s
import multiprocessing as mp import tqdm some_iterable = ... def some_func(): # your logic ... if __name__ == '__main__': with mp.Pool(mp.cpu_count()-2) as p: list(tqdm.tqdm(p.imap(some_func, iterable), total=len(iterable)))