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?
Asked
Active
Viewed 360 times
1 Answers
1
With getpass.getpass()
, which is intended for getting passwords:
>>> import getpass
>>> a = getpass.getpass()
Password:
>>> a
'asdf'

TigerhawkT3
- 48,464
- 6
- 60
- 97
-
this is great but I was actually looking for something that will take a single character from the keyboard and does not wait for the enter press to proceed. with getch() you do not have to wait for the enter press to continue to the next line(I realise that this means I can only enter one key at a time which is fine). Does anything like this exists? Thanks! – Ananda Dec 02 '16 at 16:19