On this page
  1. msvcrt.kbhit
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

msvcrt.kbhit

Prev: msvcrt.getwch | Up: msvcrt | Next: msvcrt.locking
Rel: msvcrt.getch, msvcrt.getwch, msvcrt.locking
Ref: docs.python.org — msvcrt.kbhit
Tags: #public #python3 #stdlib #msvcrt


Import

import msvcrt
from msvcrt import kbhit

Signature & Overview

msvcrt.kbhit() -> bool

Return True if a keypress is waiting to be read.

Usage

import sys

# Windows-only: returns True if a keypress is waiting to be read
assert sys.platform != "win32" or True

Gotchas

REPL Inspect

from msvcrt import kbhit
help(kbhit)

Linked from

Related notes