tty
— 终端控制函数
¶
源代码: Lib/tty.py
The
tty
module defines functions for putting the tty into cbreak and raw modes.
可用性 :Unix。
Because it requires the
termios
module, it will work only on Unix.
The
tty
模块定义了下列函数:
- tty. cfmakeraw ( mode ) ¶
-
Convert the tty attribute list mode , which is a list like the one returned by
termios.tcgetattr(), to that of a tty in raw mode.3.12 版添加。
- tty. cfmakecbreak ( mode ) ¶
-
Convert the tty attribute list mode , which is a list like the one returned by
termios.tcgetattr(), to that of a tty in cbreak mode.This clears the
ECHOandICANONlocal mode flags in mode as well as setting the minimum input to 1 byte with no delay.3.12 版添加。
Changed in version 3.12.2: The
ICRNLflag is no longer cleared. This matches Linux and macOSstty cbreakbehavior and whatsetcbreak()historically did.