Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 23rd, 2012  |  syntax: None  |  size: 0.14 KB  |  hits: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. from multiprocessing import Pool
  2.  
  3. def add1(x):
  4.     return x ^ x
  5.    
  6. pool = Pool(4)
  7. for x in pool.imap(add1, xrange(100000), 100):
  8.     print x