Name
stdin, stdout, stderr
Synopsis
stdin
,
stdout, and stderr are
predefined file objects that correspond to Python’s
standard input, output, and error streams. You can rebind
stdout and stderr to file-like
objects (objects that supply a write method
accepting a string argument) to redirect the destination of output
and error messages. You can rebind stdin to a
file-like object open for reading (one that supplies a
readline method returning a string) to redirect
the source from which built-in functions raw_input
and input read. The original values are available
as __stdin__, __stdout__,
and __stderr__. Chapter 10
covers file objects and streams.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access