Created
October 9, 2011 01:37
-
-
Save illicitonion/1273169 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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