p = subprocess.Popen(mnemonic, shell=True, stdout = subprocess.PIPE) stdout, stderr = p.communicate() print (p.returncode) code example
Example: python subprocess exception handling
try:
subprocess.check_output(...)
except subprocess.CalledProcessError as e:
print(e.output)