def processInput(i):
    return i * i
if __name__ == '__main__':
    inputs = list(range(1000000))
pool = mp.Pool(processes=4)
results = pool.map(processInput, inputs)
print(results)
Writing a parallel loop