Skip to content

Instantly share code, notes, and snippets.

@illicitonion
Created October 9, 2011 01:37
Show Gist options
  • Select an option

  • Save illicitonion/1273169 to your computer and use it in GitHub Desktop.

Select an option

Save illicitonion/1273169 to your computer and use it in GitHub Desktop.
import random
from multiprocessing import Pool
from time import sleep
def Process(x):
try:
print x
sleep(random.random())
raise Exception('Exception: ' + x)
finally:
print 'Finally: ' + x
Pool(3).map(Process, ['1','2','3'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment