Terminal Interface Modules

termios

POSIX terminal-control interface for reading and changing terminal attributes. Attributes contain input, output, control and local flags, speeds and control characters. Save original settings and restore them when done; changes affect terminal behavior. This example inspects flag constants only.

Formal Syntax & Structure

python syntaxpython
import termios

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
import termiosflags = termios.ECHO | termios.ICANONprint(bool(flags & termios.ECHO))
Python Reference