Python - getch() and kbhit()

Python - getch() and kbhit()

Shlomo Solomon shlomo.solomon at gmail.com
Tue Jan 9 10:36:51 IST 2018


Since import msvcrt in Python is Windows specific, I adapted some code
I found to provide kbhit() and getch() in Python under Linux.

I'm attaching KBHIT.py which replaces msvcrt and a small program to
demonstrate how to use it - KBHIT-test.py.

The KBHIT.py documentation includes usage instructions and also a link
to the code I borrowed and (I hope) improved. 


-- 
Shlomo Solomon
http://the-solomons.net
Claws Mail 3.11.1 - KDE 4.14.30 - Dolphin 4.14.3 - LINUX Mageia 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KBHIT-test.py
Type: text/x-python
Size: 1052 bytes
Desc: not available
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20180109/c751e4e9/KBHIT-test.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KBHIT.py
Type: text/x-python
Size: 3543 bytes
Desc: not available
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20180109/c751e4e9/KBHIT.py>


More information about the Linux-il mailing list