Reputation:
Can I get console input without echo in Python?
Upvotes: 58
Views: 42090
Reputation: 336
Maybe the 'console' module is your only bet (it's kind of a 'fork' of the curses module for Unix). However, I haven't seen anything related to terminal echo disabling in its homepage; you might try to dig into it by yourself.
Upvotes: 0
Reputation: 127
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"
Upvotes: 11