standard streams

The three streams every program starts with: standard input, standard output and standard error.

In more detail

sys.stdin is where input() reads, sys.stdout is where print() writes, and sys.stderr carries error messages and tracebacks separately from normal output. They are already open when the program starts and should not be closed. print(..., file=sys.stderr) sends text to standard error.

Example

import sys
print('done', file=sys.stderr)

Related terms

Taught in

References

Certification courses