tty --- 终端控制功能¶
Source code: Lib/tty.py
tty 模块定义了将 tty 放入 cbreak 和 raw 模式的函数。
可用性: Unix。
因为它需要 termios 模块,所以只能在 Unix 上运行。
tty 模块定义了以下函数:
- tty.setraw(fd, when=termios.TCSAFLUSH)¶
Change the mode of the file descriptor fd to raw. If when is omitted, it defaults to
termios.TCSAFLUSH, and is passed totermios.tcsetattr().
- tty.setcbreak(fd, when=termios.TCSAFLUSH)¶
Change the mode of file descriptor fd to cbreak. If when is omitted, it defaults to
termios.TCSAFLUSH, and is passed totermios.tcsetattr().
参见
- 模块
termios 低级终端控制接口。