On this page
tty.setraw
Prev: tty.setcbreak | Up: tty
Rel: tty.cfmakecbreak, tty.cfmakeraw, tty.setcbreak
Ref: docs.python.org — tty.setraw
Tags: #public #python3 #stdlib #tty
Import
import tty
from tty import setraw
Signature & Overview
tty.setraw(fd, when=2)
Put terminal into raw mode.
Usage
import tty
# Unix-only: switches a TTY fd to raw mode (even Ctrl-C arrives as byte 0x03)
assert callable(tty.setraw)
Gotchas
- Always restore saved
termiosattributes infinally:or the user's terminal will be stuck in raw mode.
REPL Inspect
from tty import setraw
help(setraw)
Linked from
Related notes
- tuts/python3/stdlib_module/tty/cfmakecbreak Linked here; links to this page; shared tags: #stdlib, #tty
- tuts/python3/stdlib_module/tty/cfmakeraw Linked here; links to this page; shared tags: #stdlib, #tty
- tuts/python3/stdlib_module/tty/setcbreak Linked here; links to this page; shared tags: #stdlib, #tty
- tuts/python3/stdlib_module/tty Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib