Skip to content

Instantly share code, notes, and snippets.

@Artiomio
Artiomio / keyboard_fly.py
Last active October 11, 2021 11:21
Python Linux/Windows async keyboard library - non-blocking keyboard input - read one character at a time
from __future__ import print_function
try:
import msvcrt
def key_pressed():
return msvcrt.kbhit()
def read_key():
key = msvcrt.getch()