rest25/library/termios.rst => rest262/library/termios.rst
26control interfaces.
27
28The module defines the following functions:
29
30
31.. function:: tcgetattr(fd)
32
33   Return a list containing the tty attributes for file descriptor *fd*, as
n34-   follows: ``[``*iflag**oflag**cflag**lflag**ispeed**ospeed*, *cc*``]``
n34+   follows: ``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` where *cc* is a
35-   where *cc* is a list of the tty special characters (each a string of length 1,
35+   list of the tty special characters (each a string of length 1, except the
36-   except the items with indices :const:`VMIN` and :const:`VTIME`, which are
36+   items with indices :const:`VMIN` and :const:`VTIME`, which are integers when
37-   integers when these fields are defined).  The interpretation of the flags and
37+   these fields are defined).  The interpretation of the flags and the speeds as
38-   the speeds as well as the indexing in the *cc* array must be done using the
38+   well as the indexing in the *cc* array must be done using the symbolic
39-   symbolic constants defined in the :mod:`termios` module.
39+   constants defined in the :mod:`termios` module.
40
41
42.. function:: tcsetattr(fd, when, attributes)
43
44   Set the tty attributes for file descriptor *fd* from the *attributes*, which is
45   a list like the one returned by :func:`tcgetattr`.  The *when* argument
46   determines when the attributes are changed: :const:`TCSANOW` to change
47   immediately, :const:`TCSADRAIN` to change after transmitting all queued output,
78
79   Module :mod:`tty`
80      Convenience functions for common terminal control operations.
81
82
83Example
84-------
85
t86-.. _termios example:
t86+.. _termios-example:
87
88Here's a function that prompts for a password with echoing turned off.  Note the
89technique using a separate :func:`tcgetattr` call and a :keyword:`try` ...
90:keyword:`finally` statement to ensure that the old tty attributes are restored
91exactly no matter what happens::
92
93   def getpass(prompt = "Password: "):
94       import termios, sys
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op