Joe Mornin
Joe Mornin

Reputation: 9154

Fabric prompt() for passwords

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?

Upvotes: 0

Views: 1546

Answers (1)

Robert Jacobs
Robert Jacobs

Reputation: 3360

http://docs.python.org/2/library/getpass.html

getpass.getpass('Password: ')

Upvotes: 5

Related Questions