code: def popen(self, cmd):
          
          process = Popen(cmd, shell=True, stdout=PIPE, env=self.env)
          stdoutdata, stderrdata = process.communicate()
          return process.returncode, stdoutdata
docs: Execute an external command and return (rc, output).