How to declare a password input?

5

I wonder if there is a way to mask character entry in input() of python.

Ex:

Senha = 1234

Entrada = int(input("Digite sua senha: ")) 

In the above entry I wanted to change the letters entered by asterisks.

Is there any way to do this in python?

    
asked by anonymous 31.12.2016 / 22:19

1 answer

8

You can try to use the "getpass" module.

import getpass
senha = getpass.getpass("Digite sua senha: ")

It will display asterisks when entering the password.

    
31.12.2016 / 23:40