SHARE
TWEET

Untitled

a guest Sep 5th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import multiprocessing
  2.  
  3. def function(a):
  4.     v = a**2
  5.     w = a**3
  6.     x = a**4
  7.     y = a**5
  8.     z = a**6
  9.     return v, w, x, y, z
  10.  
  11. b = [1,2,3,4,5,6,7,8,9,10]
  12.  
  13. pool = multiprocessing.Pool(processes=4)
  14. vals = pool.imap(function, b)
  15.  
  16. for i in vals:
  17.     print i
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top