Skip to content

Instantly share code, notes, and snippets.

@sanfx
Created August 10, 2014 06:50
Show Gist options
  • Select an option

  • Save sanfx/835ca3b4efb19606e42c to your computer and use it in GitHub Desktop.

Select an option

Save sanfx/835ca3b4efb19606e42c to your computer and use it in GitHub Desktop.
from concurrent.futures import ProcessPoolExecutor
def calculate(number):
return number
with ProcessPoolExecutor() as executor:
result = executor.map(calculate, range(4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment