Hidding Character as you type

MRAB python at mrabarnett.plus.com
Thu Sep 22 12:41:32 EDT 2016


On 2016-09-22 17:16, Andrew Clark wrote:
> I'm looking for a way to either completely hide character as you type in command line or add ***** to each character as you for simple password obscurity. I've tried getpass.getpass() however the characters still show up on the screen as you type it. Can anyone help? I'm using python 2.7 on windows.
>
> host = 'ldxnis12.dx.deere.com'
>     username = raw_input("Enter username: ")
>     password = raw_input("Enter password: ")
>
>
> Output:
>
> Enter username: username
> Enter password: iwanthistonotshowup
>
Here's an answer on StackOverflow:

How to read password with echo “*” in Python console program?
http://stackoverflow.com/questions/7838564/how-to-read-password-with-echo-in-python-console-program




More information about the Python-list mailing list