Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from multiprocessing import Pool
- def calculate(x):
- y = 2
- res = x ** y
- return res
- if __name__ == '__main__':
- p = Pool(processes=5)
- new_ls = p.map(calculate, [i / 10 for i in range(11)])
- print(new_ls)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement