termios
The termios module provides a POSIX-style interface for controlling the behavior of TTYs and other serial communication devices on UNIX systems. All the functions operate on integer file descriptors such as those returned by the os.open() function or the fileno() method of a file object. In addition, the module relies on a large collection of constants that are also defined in this module.
tcgetattr(fd)
Returns a list [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] of TTY attributes for a file descriptor, fd. The meaning of these fields is as follows:
Field | Description |
---|---|
iflag | Input modes (integer) |
oflag | Output modes (integer) |
cflag | Control modes (integer) |
lflag | Local modes (integer) |
ispeed | Input speed (integer) |
ospeed | Output speed (integer) |
cc | A list ... |
Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.