def redirect_to_stdout(stream):
    for line in stream:
        sys.stdout.write(line)
sys.stdout.flush()
cmd = ['vsmake.exe', '-f']
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stderr_thread = threading.Thread(target=redirect_to_stdout, args=(p.stderr,))
stderr_thread.start()
redirect_to_stdout(p.stdout)
p.wait()
stderr_thread.join()
Обработка сообщений от дочернего процесса через stderr и stdout с помощью Python