QuestionQ29

VerifiedPython Basics

If the variable example holds a handle to a subprocess object, which of the following would display every possible result from running that subprocess?

Explanation

A subprocess may write output to both standard output and standard error. stdout.read() retrieves only standard output, while combining stdout.read() with stderr.read() includes data from both streams. The Python documentation identifies Popen.stdout and Popen.stderr as readable streams for the child process’s output and error output, respectively.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!