1import os
2cmd = "git --version"
3returned_value = os.system(cmd) # returns the exit code in unix
1import subprocess
2
3output = subprocess.check_output('pidstat -p ALL'.split(' '), stderr=subprocess.STDOUT, universal_newlines=True)
4print(output)
1import subprocess
2subprocess.call(["./shell.sh"])
3
4# Make sure that "shell.sh" has "+x" permissions