PyDocs

MS Windows Specific Services

MS Windows Specific Services

msvcrt

Windows

These functions provide access to some useful capabilities on Windows platforms. Some higher-level modules use these functions to build the Windows implementations of their services. For example, the getpass module uses this in the implementation of the getpass() function.
Symbols in msvcrt

c

CRT_ASSEMBLY_VERSION
The CRT Assembly version, from the crtassem.h header file.
CRT_ASSERT
Assertion failures.
CRT_ERROR
Errors, unrecoverable problems, and issues that require immediate attention.
CRT_WARN
Warnings, messages, and information that doesn’t need immediate attention.
CRTDBG_MODE_DEBUG
Writes the message to the debugger’s output window.
CRTDBG_MODE_FILE
Writes the message to a user-supplied file handle.
CRTDBG_MODE_WNDW
Creates a message box to display the message along with the Abort, Retry, and Ignore buttons.
CRTDBG_REPORT_MODE
Returns current mode for the specified type.
CrtSetReportFile
After you use CrtSetReportMode() to specify CRTDBG_MODE_FILE, you can specify the file handle to receive the message text.
CrtSetReportMode
Specifies the destination or destinations for a specific report type generated by _CrtDbgReport() in the MS VC++ runtime.

g

get_osfhandle
Return the file handle for the file descriptor fd.
getch
Read a keypress and return the resulting character as a byte string.
getche
Similar to getch(), but the keypress will be echoed if it represents a printable character.
getwch
Wide char variant of getch(), returning a Unicode value.
getwche
Wide char variant of getche(), returning a Unicode value.

h

heapmin
Force the malloc() heap to clean itself up and return unused blocks to the operating system.

k

kbhit
Returns a nonzero value if a keypress is waiting to be read.

l

LIBRARIES_ASSEMBLY_NAME_PREFIX
The Libraries Assembly name prefix, from the crtassem.h header file.
LK_LOCK
Locks the specified bytes.
LK_NBLCK
Locks the specified bytes.
LK_NBRLCK
Locks the specified bytes.
LK_RLCK
Locks the specified bytes.
LK_UNLCK
Unlocks the specified bytes, which must have been previously locked.
locking
Lock part of a file based on file descriptor fd from the C runtime.

o

open_osfhandle
Create a C runtime file descriptor from the file handle handle.
OUT_TO_DEFAULT
Error sink is determined by the app’s type.
OUT_TO_MSGBOX
Error sink is a message box.
OUT_TO_STDERR
Error sink is a standard error.

p

putch
Print the byte string char to the console without buffering.
putwch
Wide char variant of putch(), accepting a Unicode value.

r

REPORT_ERRMODE
Report the current error mode value.

s

set_error_mode
Changes the location where the C runtime writes an error message for an error that might end the program.
setmode
Set the line-end translation mode for the file descriptor fd.

u

ungetch
Cause the byte string char to be “pushed back” into the console buffer; it will be the next character read by getch() or getche().
ungetwch
Wide char variant of ungetch(), accepting a Unicode value.

v

VC_ASSEMBLY_PUBLICKEYTOKEN
The VC Assembly public key token, from the crtassem.h header file.