Advertisement
Guest User

Untitled

a guest
Jun 24th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Simple multiprocessing/threading example in python?
  2. def myfunct(d):
  3. facto = 1
  4. for x in range(d):
  5. facto*=x
  6. return facto
  7.  
  8.  
  9. cases = [1,2,3,4] # and so on
  10. for d in cases: #loop to parallelize
  11. print myfunct(d) # or to store on a common list when calculated
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement