http://docs.python.org/2/library/getpass.html
getpass.getpass('Password: ')
سؤال
Fabric includes the prompt() operation to collect input from the user:
fabric.operations.prompt(text, key=None, default='', validate=None)
At one point, I ask the user for a password:
pw = prompt('Password:')
When the user types his password, it's displayed in the shell in plain text. Is it possible to keep the user's input hidden?
المحلول
http://docs.python.org/2/library/getpass.html
getpass.getpass('Password: ')