sys.stdin
sys.stdout
sys.stderr
File objects used by the interpreter for standard input, output and errors:
stdin
is used for all interactive input (including calls to input()
);
stdout
is used for the output of print()
and expression statements and for the prompts of input()
;
The interpreter’s own prompts and its error messages go to stderr
.
For your more understanding:
>>> import sys
>>> for i in (sys.stdin, sys.stdout, sys.stderr):
... print i
...
<open file '<stdin>', mode 'r' at 0x103451150>
<open file '<stdout>', mode 'w' at 0x1034511e0>
<open file '<stderr>', mode 'w' at 0x103451270>
mode r
means reading and mode w
means writing