Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import multiprocessing
  2.  
  3. def calculate(x):
  4. # here is where I would take this input x (and maybe a couple more inputs)
  5. # and build a larger library of variables that I use further down the line
  6.  
  7. def domath(y):
  8. return x * y
  9.  
  10. pool = multiprocessing.Pool(3)
  11. final= pool.map(domath, range(3))
  12.  
  13. calculate(2)
  14.  
  15. Can't pickle <type 'function'>: attribute lookup __builtin__.function failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement