Skip to content

Instantly share code, notes, and snippets.

@seungjin
Created April 29, 2011 23:59
Show Gist options
  • Save seungjin/949257 to your computer and use it in GitHub Desktop.
Save seungjin/949257 to your computer and use it in GitHub Desktop.
run shell command in python
import subprocess
run_cmd = lambda c : subprocess.Popen(c.split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False).stdout.read()
run_cmd = lambda c,a : subprocess.Popen(c.split(None,a), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False).stdout.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment