Python - getch() and kbhit()

Python - getch() and kbhit()

Shlomi Fish shlomif at gmail.com
Tue Jan 9 12:21:51 IST 2018


Hi Shlomo,

On Tue, Jan 9, 2018 at 10:36 AM, Shlomo Solomon <shlomo.solomon at gmail.com>
wrote:

> 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.
>
>
thanks for your contribution.

some comments:

1. What is the licence of the code? See
https://www.mail-archive.com/perl6-users@perl.org/msg04541.html .

2. Please use a PyPI-like distribution format, see
https://github.com/ofek/hatch or
https://github.com/audreyr/cookiecutter-pypackage .

3. For more best practices, see
https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ.mdwn#what-are-some-best-practices-in-programming-that-i-should-adopt
.

4. -test.py should be -example.py


>
> --
> Shlomo Solomon
> http://the-solomons.net
> Claws Mail 3.11.1 - KDE 4.14.30 - Dolphin 4.14.3 - LINUX Mageia 5
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
>


-- 
Shlomi Fish http://www.shlomifish.org/

You can never truly appreciate The Gilmore Girls until you've watched it in
the original Klingon.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20180109/0912ce49/attachment-0001.html>


More information about the Linux-il mailing list