def Run(command):
    proc = subprocess.Popen(command, bufsize=1, stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT, universal_newlines=True)
return proc
Python monitoring stderr and stdout of a subprocess