Re: Python - getch() and kbhit()
Shlomi Fish <[email protected]> Tue, 9 Jan 2018 12:21:51 +0200
| Newsgroups | gmane.linux.region.israel |
|---|---|
| Message-ID | <CANy4znXy3So4kvB+0nWK62JWAtvOxTWFWd1Prghd0S0Fnxbudw@mail.gmail.com> |
Hi Shlomo, On Tue, Jan 9, 2018 at 10:36 AM, Shlomo Solomon <[email protected]> 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/[email protected]/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 > [email protected] > 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 . _______________________________________________ Linux-il mailing list [email protected] http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il