Skip to content

Instantly share code, notes, and snippets.

@Serpens
Last active November 16, 2015 12:50
Show Gist options
  • Save Serpens/0b0a049ef2a331edf99e to your computer and use it in GitHub Desktop.
Save Serpens/0b0a049ef2a331edf99e to your computer and use it in GitHub Desktop.
import subprocess
ps = Popen(['cmd', 'arg1', 'arg2'], stdout=PIPE, stdin=PIPE, stderr=STDOUT, env={'variable' : value}, shell=False)
ps.communicate('input\n')
if ps.wait():
print 'Failed'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment