Ananda
Ananda

Reputation: 3272

Is there a getch() analog in python?

In C/C++ if you want to enter a character without anything being printed on the screen, you can use getch(). Is there any way I can do this in python?

Upvotes: 1

Views: 467

Answers (1)

TigerhawkT3
TigerhawkT3

Reputation: 49318

With getpass.getpass(), which is intended for getting passwords:

>>> import getpass
>>> a = getpass.getpass()
Password:
>>> a
'asdf'

Upvotes: 1

Related Questions