是否可以用python来解决运行两个可执行文件并且它们可以相互通信(stdin/stdout)的问题?
我有两个可执行文件,例如A.exe、B.exe。 使用python子进程popen,两个可执行文件是否可以通过stdin/stdout相互通信:是否可以用python来解决运行两个可执行文件并且它们可以相互通信(stdin/stdout)的问题?,python,redirect,stdout,stdin,Python,Redirect,Stdout,Stdin,我有两个可执行文件,例如A.exe、B.exe。 使用python子进程popen,两个可执行文件是否可以通过stdin/stdout相互通信: A = Popen("A.exe",...,stdin=B.stdout, stdout=PIPE) B = Popen("B.exe",...,stdin=A.stdout, stdout=PIPE) ? (其中A.exe包含print/scanf对,B.exe包含scanf/printfs。)尝试Popen.communicate它使用参数输入和
A = Popen("A.exe",...,stdin=B.stdout, stdout=PIPE)
B = Popen("B.exe",...,stdin=A.stdout, stdout=PIPE) ?
(其中A.exe包含print/scanf对,B.exe包含scanf/printfs。)尝试
Popen.communicate
它使用参数输入
和文本发送到子进程,并返回元组(stdout\u数据,stderr\u数据)
不知道你在问什么,尽管
pexpect
和两者都运行并执行你希望从一个到另一个的任何操作?似乎是重复的
(output, error) = A.communicate(input="send to a")