On this page
msvcrt.getwch
Prev: msvcrt.getch | Up: msvcrt | Next: msvcrt.kbhit
Rel: msvcrt.getch, msvcrt.kbhit, msvcrt.locking
Ref: docs.python.org — msvcrt.getwch
Tags: #public #python3 #stdlib #msvcrt
Import
import msvcrt
from msvcrt import getwch
Signature & Overview
msvcrt.getwch() -> str
Wide char variant of getch(), returning a Unicode value.
Usage
import sys
# Windows-only: reads a single Unicode character keypress without echo
assert sys.platform != "win32" or True
Gotchas
- Windows-only: Special keys (arrows/F-keys) return
'\x00'or'\xe0'first, requiring a secondgetwch()call.
REPL Inspect
from msvcrt import getwch
help(getwch)
Linked from
Related notes
- tuts/python3/stdlib_module/msvcrt/getch Linked here; links to this page; shared tags: #msvcrt, #stdlib
- tuts/python3/stdlib_module/msvcrt/kbhit Linked here; links to this page; shared tags: #msvcrt, #stdlib
- tuts/python3/stdlib_module/msvcrt/locking Linked here; links to this page; shared tags: #msvcrt, #stdlib
- tuts/python3/stdlib_module/msvcrt Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib