On this page
termios.tcgetattr
Prev: termios.tcflush | Up: termios | Next: termios.tcgetwinsize
Rel: termios.error, termios.tcdrain, termios.tcflow, termios.tcflush
Ref: docs.python.org — termios.tcgetattr
Tags: #public #python3 #stdlib #termios
Import
import termios
from termios import tcgetattr
Signature & Overview
termios.tcgetattr(fd, /)
Get the tty attributes for file descriptor fd.
Usage
import termios
# Always save old = termios.tcgetattr(fd) before modifying terminal flags
assert callable(termios.tcgetattr)
Gotchas
- Returns
[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]: Always restore in afinally:block.
REPL Inspect
from termios import tcgetattr
help(tcgetattr)
Linked from
Related notes
- tuts/python3/stdlib_module/termios/error Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcdrain Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcflow Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcflush Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcgetwinsize Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/termios/tcsendbreak shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcsetattr shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcsetwinsize shared tags: #stdlib, #termios
- tuts/c/stdlib shared tags: #stdlib