import multiprocessing def function_square(data): result=data*data return result
if name=="main": inputs=list(range(100)) pool=multiprocessing.Pool(processes=4) outs=pool.map(function_square,inputs) pool.close() pool.join() print(outs)
import multiprocessing def function_square(data): result=data*data return result
if name=="main": inputs=list(range(100)) pool=multiprocessing.Pool(processes=4) outs=pool.map(function_square,inputs) pool.close() pool.join() print(outs)