GPYC Exam QuestionsBrowse all questions from this exam

GPYC 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?

Show Answer
Correct Answer: C,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

1 comment
Sign in to comment
kyaoOption: D
Apr 21, 2024

The answer is D