O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

FieldDescription
iflagInput modes (integer)
oflagOutput modes (integer)
cflagControl modes (integer)
lflagLocal modes (integer)
ispeedInput speed (integer)
ospeedOutput speed (integer)
ccA list ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required