As allternative you might want to try the commands.getstatusoutput() method, it returns a tuple with the exit code and output of the command you run, see http://docs.python.org/lib/module-commands.html