Answers for "how to run single loop iterations on same time in python"

1

how to run single loop iterations on same time in python

from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4)
results = pool.map(my_function, my_array)
Posted by: Guest on October-17-2021
0

how to run single loop iterations on same time in python

results = []
for item in my_array:
    results.append(my_function(item))
Posted by: Guest on October-17-2021

Code answers related to "how to run single loop iterations on same time in python"

Python Answers by Framework

Browse Popular Code Answers by Language