Skip to content

Instantly share code, notes, and snippets.

@nside
Created January 13, 2015 01:06
Show Gist options
  • Save nside/a9ed833ee0b0d0bf82d5 to your computer and use it in GitHub Desktop.
Save nside/a9ed833ee0b0d0bf82d5 to your computer and use it in GitHub Desktop.
reads commands to run on stdin and runs them simultaneously
import multiprocessing, sys, os, fileinput
p = multiprocessing.Pool(4)
p.map(os.system, sys.stdin.readlines())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment