2

How do you conceal the input of raw_input? For example, I want:

password = raw_input("Password: ")

To be

Password: ********
#or
Password: #hide the characters (i.e. no echo)

Instead of displaying the string. How can I do so?

Eugene
  • 161
  • 1
  • 1
  • 8

1 Answers1

3

Use getpass:

import getpass

password = getpass.getpass('Password: ')
Nicolas
  • 5,583
  • 1
  • 25
  • 37