Last active
December 27, 2015 11:28
-
-
Save samuell/7318407 to your computer and use it in GitHub Desktop.
Spawning parallel jobs with NuMap
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
| from numap import NuMap | |
| import time | |
| def capitalizer(name): | |
| time.sleep(1) | |
| return name.capitalize() | |
| namelist = ('rolf', 'mariann', 'samuel', 'sandra', 'simon', 'theresa', 'jonathan', 'elias', 'miryam') | |
| result_iterator = NuMap(capitalizer, namelist) | |
| for name in result_iterator: | |
| print name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment