How can I call an external program with a python script and retrieve the output and return code?
Following Ambroz Bizjak's previous comment, here is a solution that worked for me:
import shlex from subprocess import Popen, PIPE cmd = "..." process = Popen(shlex.split(cmd), stdout=PIPE) process.communicate() exit_code = process.wait()