2

So I am using the following in my script to capture the stdout and stderr output from my subprocess:

output = subprocess.check_output( cmd, stderr=subprocess.STDOUT ) 

This is working swimmingly, however, my subprocess has a subprocess it itself calls. The subprocess it itself calls has output I would like to capture. However, with my current set up, I only capture the output of the subprocess I create, and do not receive any of the output of it's child process.

Is there any way I can capture the output of any child subprocess spawned by a subprocess that my code is starting?

1 Answer 1

1

The process cannot access to the output of the sub-subprocess so the intermediate subprocess has to behave as a proxy (it writes in its output the output of the sub-subprocess) or the sub-subprocess has to send its output somewhere (a temporary file for example) which will be read by the process

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.