code: def runproc(cmd):
      
      proc = Popen([cmd], shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE,
              close_fds=True)
      stdoutdata, stderrdata = proc.communicate()
      return (stdoutdata, stderrdata)
docs: Convenience method for executing operating system commands.
  
      Accepts a single string that would be the command as executed on the
      command line.
  
      Returns a 2-tuple consisting of the output of (STDOUT, STDERR). In your
      code you should check for an empty STDERR output to determine if your
      command completed successfully.