Wrap subprocess' stdout/stderr

后端 未结 4 2010
既然无缘
既然无缘 2020-12-05 16:00

I\'d like to both capture and display the output of a process that I invoke through Python\'s subprocess.

I thought I could just pass my file-like object as named pa

4条回答
  •  醉梦人生
    2020-12-05 16:50

    A file-like is not close enough. It must be an actual file with an actual file descriptor. Use subprocess's support for pipes and read from them as appropriate.

提交回复
热议问题