Python multiprocessing: How can I RELIABLY redirect stdout from a child process?

前端 未结 5 641
不知归路
不知归路 2020-12-08 14:27

NB. I have seen Log output of multiprocessing.Process - unfortunately, it doesn\'t answer this question.

I am creating a child process (on windows) via multiprocessi

5条回答
  •  悲&欢浪女
    2020-12-08 14:48

    I assume I'm off base and missing something, but for what it's worth here is what came to mind when I read your question.

    If you can intercept all of the stdout and stderr (I got that impression from your question), then why not add or wrap that capture functionality around each of your processes? Then send what is captured through a queue to a consumer that can do whatever you want with all of the outputs?

提交回复
热议问题