def runproc(cmd):
 proc = Popen([cmd], shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
 (stdoutdata, stderrdata) = proc.communicate()
 return (stdoutdata, stderrdata)

def runproc ( cmd ) : proc = Popen ( [ cmd ] , shell = True , stdin = PIPE , stdout = PIPE , stderr = PIPE , close_fds = True ) ( stdoutdata , stderrdata ) = proc . communicate ( ) return ( stdoutdata , stderrdata )
convenience method for executing operating system commands .