Twisted Python: Cannot write to a running spawned process

前端 未结 2 2260
既然无缘
既然无缘 2021-01-23 12:02

My question is, after spawning a process, the child process is looping to get data from its stdin. I would like to write new data to it using either Echo.Process.pipes[0].write(

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-23 12:33

    Don't pass childFDs to spawnProcess and don't use the pipes attribute of the resulting process transport object. Neither of these things does what you think. If you drop the use of childFDs and switch back to writeToChild, you'll get the behavior you want.

提交回复
热议问题