Created
August 13, 2013 15:47
-
-
Save ajdavis/6222554 to your computer and use it in GitHub Desktop.
Start a process and redirect its stdout and stderr to /dev/null.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from subprocess import DEVNULL # Python 3. | |
except ImportError: | |
DEVNULL = open(os.devnull, 'wb') | |
def start_subprocess(cmd): | |
"""Run cmd (a list of strings) and return a Popen instance.""" | |
return subprocess.Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very helpful, thanks!