Can i get console input without echo in python?

Can I get console input without echo in python?


Use getpass:

>>> from getpass import getpass
>>> getpass()
Password:
'secret'

There is also another solution (at least on unix systems, I don't know if this is working on Windows). Simply switch off the console output and use raw_input:

os.system("stty -echo")
password = raw_input('Enter Password:')
os.system("stty echo")
print "\n"