termios

This module provides an interface to the Posix calls for tty I/O control. For a complete description of these calls, see the Posix or Unix manual pages. It is only available for those Unix versions that support Posix termios style tty I/O control.

All functions in this module take a file descriptor fd as their first argument. This can be an integer file descriptor, such as returned by sys.stdin.fileno(), or a file object, such as sys.stdin itself.

Functions

tcdrain((fd) -> None) Wait until all output written to file descriptor fd has been transmitted.
tcflow((fd, action) -> None) Suspend or resume input or output on file descriptor fd.
tcflush((fd, queue) -> None) Discard queued data on file descriptor fd.
tcgetattr((fd) -> list_of_attrs) Get the tty attributes for file descriptor fd, as follows: [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] where cc is a list of the tty special characters (each a string of length 1, except the items with indices VMIN and VTIME, which are integers when these fields are defined).
tcsendbreak((fd, duration) -> None) Send a break on file descriptor fd.
tcsetattr((fd, when, attributes) -> None) Set the tty attributes for file descriptor fd.

Exceptions

error