Redirecting stdio from a command in os.system() in Python

On a unix system, you can redirect stderr and stdout to /dev/null as part of the command itself.

os.system(cmd + "> /dev/null 2>&1")

Leave a Comment