ErikT
ErikT

Reputation: 606

How can I have an encrypted input in Python?

I am writing a Python program that requires a user to input their gmail usernames and passwords. When the user types in their password, I want the characters to be displayed as asterisks. Is this possible for a command-line program?

Upvotes: 1

Views: 1535

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798446

getpass.getpass() doesn't show asterisks but instead suppresses all output, which is expected behavior on some systems.

Upvotes: 5

Related Questions