git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Implementing C++'s getch() in Python


On Sat, 25 May 2019 at 12:12, <binoythomas1108 at gmail.com> wrote:
>
> I'm working on Python 3.7 under Windows. I need a way to input characters without echoing them on screen, something that getch() did effectively in C++. I read about the unicurses, ncurses and curses modules, which I was not able to install using pip.
>
> Is there any way of getting this done?

On Windows, the msvcrt module exposes getch:
https://docs.python.org/3.7/library/msvcrt.html#msvcrt.getch