Exam GPYC All QuestionsBrowse all questions from this exam
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?

    Correct Answer: D

    To show all of the possible results of running the subprocess, you need to capture both standard output and standard error. Using example.stdout.read() retrieves the standard output, whereas using example.stderr.read() retrieves the standard error. Hence, combining both with example.stdout.read() + example.stderr.read() ensures that you get all possible results from the subprocess.

Discussion
kyaoOption: D

The answer is D