Python子流程:使用Pipe和communici的困难

2024-10-06 19:17:53 发布

您现在位置:Python中文网/ 问答频道 /正文

C Code of binary format3

Python Code

我基本上是在python脚本中运行“(./format3 | attackString)| grep searchString”, 但是我无法访问format3进程的管道(代码中的baby),因为它在communicate调用之后是关闭的

我需要communicate调用将我的attackString提供给二进制文件。 我知道我可以将baby的stdout写入一个文件,然后将该文件用作grep的stdin,但我觉得必须有另一种方法来解决这个问题


Tags: 文件of代码脚本管道进程二进制code