input(), raw_input(), echoing input as asterisks

python

Solution

Try the getpass module.

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

This does not echo the asterisks, but it does hide your typing, which is presumably the goal.

Problem

Is there a way to protect user input by echoing asterisks ? Or do i need to look at a different approach and use something aside from input(). Seems sloppy to have the user enter in their credentials without some rudimentary protection or consideration. When using getpass I am then unable to authenticate to gmail. Are there other considerations or some "unpacking" that needs to be done with pass=getpass.getpass('enter password')?

Original source

Related problems