Input (), raw_input (), asterisk echo

Is there a way to protect user input by repeating asterisks?

Or I need to look at a different approach and use something other than input ().

It seems inaccurate for the user to enter their credentials without any elementary protection or consideration.

When using getpass, I cannot authenticate with gmail.

Are there other considerations or some “unpacking” that needs to be done with pass = getpass.getpass (“enter password”)?

+3
source share
1 answer

Try to get a module .

import getpass
mypass = getpass.getpass("Please enter your password:")

This does not affect the asterisks, but it hides your typing, which seems to be the goal.

+5

All Articles