GIAC Python Coder (GPYC) — Question 22

If the variable `example` contains a handle to a subprocess object, which of the following would show all of the possible results of running the subprocess?

Answer options

Correct answer: C

Explanation

The correct answer is C, as the method example.read() will capture all output from the subprocess. Option A only retrieves standard output, while option B is not applicable for this context, and option D would only concatenate outputs from stdout and stderr, potentially missing some outputs.