Skip to content

Instantly share code, notes, and snippets.

@tuksik
Created September 13, 2015 09:34
Show Gist options
  • Save tuksik/70208f458eefb96de748 to your computer and use it in GitHub Desktop.
Save tuksik/70208f458eefb96de748 to your computer and use it in GitHub Desktop.
# http://stackoverflow.com/questions/1378974/is-there-a-way-to-start-stop-linux-processes-with-python
# WARNING https://docs.python.org/2/library/subprocess.html#frequently-used-arguments
def CMD(cmd) :
p = subprocess.Popen(cmd, shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=False)
return (p.stdin, p.stdout, p.stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment