rest25/library/msvcrt.rst => rest262/library/msvcrt.rst
11These functions provide access to some useful capabilities on Windows platforms.
12Some higher-level modules use these functions to build the  Windows
13implementations of their services.  For example, the :mod:`getpass` module uses
14this in the implementation of the :func:`getpass` function.
15
16Further documentation on these functions can be found in the Platform API
17documentation.
18
n19+The module implements both the normal and wide char variants of the console I/O
20+api. The normal API deals only with ASCII characters and is of limited use
21+for internationalized applications. The wide char API should be used where
22+ever possible
19
20.. _msvcrt-files:
21
22File Operations
23---------------
24
25
26.. function:: locking(fd, mode, nbytes)
58   Set the line-end translation mode for the file descriptor *fd*. To set it to
59   text mode, *flags* should be :const:`os.O_TEXT`; for binary, it should be
60   :const:`os.O_BINARY`.
61
62
63.. function:: open_osfhandle(handle, flags)
64
65   Create a C runtime file descriptor from the file handle *handle*.  The *flags*
n66-   parameter should be a bit-wise OR of :const:`os.O_APPEND`, :const:`os.O_RDONLY`,
n70+   parameter should be a bitwise OR of :const:`os.O_APPEND`, :const:`os.O_RDONLY`,
67   and :const:`os.O_TEXT`.  The returned file descriptor may be used as a parameter
68   to :func:`os.fdopen` to create a file object.
69
70
71.. function:: get_osfhandle(fd)
72
73   Return the file handle for the file descriptor *fd*.  Raises :exc:`IOError` if
74   *fd* is not recognized.
90   Read a keypress and return the resulting character.  Nothing is echoed to the
91   console.  This call will block if a keypress is not already available, but will
92   not wait for :kbd:`Enter` to be pressed. If the pressed key was a special
93   function key, this will return ``'\000'`` or ``'\xe0'``; the next call will
94   return the keycode.  The :kbd:`Control-C` keypress cannot be read with this
95   function.
96
97
n102+.. function:: getwch()
103+ 
104+   Wide char variant of :func:`getch`, returning a Unicode value.
105+ 
106+   .. versionadded:: 2.6
107+ 
108+ 
98.. function:: getche()
99
100   Similar to :func:`getch`, but the keypress will be echoed if it  represents a
101   printable character.
n113+ 
114+ 
115+.. function:: getwche()
116+ 
117+   Wide char variant of :func:`getche`, returning a Unicode value.
118+ 
119+   .. versionadded:: 2.6
102
103
104.. function:: putch(char)
105
106   Print the character *char* to the console without buffering.
107
108
n127+.. function:: putwch(unicode_char)
128+ 
129+   Wide char variant of :func:`putch`, accepting a Unicode value.
130+ 
131+   .. versionadded:: 2.6
132+ 
133+ 
109.. function:: ungetch(char)
110
111   Cause the character *char* to be "pushed back" into the console buffer; it will
112   be the next character read by :func:`getch` or :func:`getche`.
t138+ 
139+ 
140+.. function:: ungetwch(unicode_char)
141+ 
142+   Wide char variant of :func:`ungetch`, accepting a Unicode value.
143+ 
144+   .. versionadded:: 2.6
113
114
115.. _msvcrt-other:
116
117Other Functions
118---------------
119
120
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op