我想在一个进程(当前进程)和系统中现有的其他进程之间使用python创建管道或队列。我怎么能做到?我知道当前和其他进程ID。 我在32位Windows上工作。
这样地。
python one_process.py | python the_other_process.py
让操作系统为您工作。
在 one_process.py 你写信给 sys.stdout .
one_process.py
sys.stdout
在 the_other_process.py ,你从 sys.stdin .
the_other_process.py
sys.stdin
就是这样。