How can I get user input on Windows without echo in a Python script?

Home / python / How can I get user input on Windows without echo in a Python script?

Question:
I’m using python 2.7.9 on Windows 7. I need to obtain a password from a user in order to connect to a resource. It seems that userpass = getpass.getpass("Password :") is the de facto standard for this in Python, however in Windows 7, the inputted text is just happily echoed to the output screen.

How can I mask the user input in the console or whatever when running my Python script? Thank you


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *