tty --- 端末制御のための関数群

ソースコード: Lib/tty.py


tty モジュールは端末を cbreak および raw モードにするための関数を定義しています。

このモジュールは 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 to termios.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 to termios.tcsetattr().

参考

モジュール termios

低水準端末制御インターフェース。