Skip to content

Instantly share code, notes, and snippets.

@samuell
Last active December 27, 2015 11:28
Show Gist options
  • Select an option

  • Save samuell/7318407 to your computer and use it in GitHub Desktop.

Select an option

Save samuell/7318407 to your computer and use it in GitHub Desktop.
Spawning parallel jobs with NuMap
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