Re: Python - getch() and kbhit()
Shlomi Fish <[email protected]> Tue, 9 Jan 2018 13:00:13 +0200
| Newsgroups | gmane.linux.region.israel |
|---|---|
| Message-ID | <CANy4znX5PE9xE+U14z7g_YLe+yJtrwUsVftY0dzE8T3xR9Ta6g@mail.gmail.com> |
thanks for the update, Shlomo. On Tue, Jan 9, 2018 at 12:40 PM, Shlomo Solomon <[email protected]> wrote: > Hi Shlomi, > Thanks for your feedback - my reply below. > > On Tue, 9 Jan 2018 12:21:51 +0200 > Shlomi Fish <[email protected]> wrote: > > > 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 . > > Note the following statement in the code (was already in the code I > "borrowed" and I felt it would be wrong/dis-honest to change it): > This program is free software: you can redistribute it and/or modify > it under the terms of the GNU Lesser General Public License as > published by the Free Software Foundation, either version 3 of the > License, or (at your option) any later version. > > > > > 2. Please use a PyPI-like distribution format, see > > https://github.com/ofek/hatch or > > https://github.com/audreyr/cookiecutter-pypackage . > > You're probably right, but since this was just something I hacked > together to solve a specific problem I was having, I didn't really see > the need to "formalize" it. > > > > > 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 > > > > > > > > > > > > > > -- > Shlomo Solomon > http://the-solomons.net > Claws Mail 3.11.1 - KDE 4.14.30 - Dolphin 4.14.3 - LINUX Mageia 5 > -- 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