Python is displayed on the screen does not allow input password

Use getpass module

# ! / Usr / bin / Python the env 
Import getpass 
username = the raw_input ( " username: " ) 
password = getpass.getpass ( " password: " )     # The first getpass is the module, the second module which is a function of getpass 

if == username ' Bob '  and password == ' 123456 ' :
 Print  ' the Login successful ' 
the else :
 Print  ' the Login here Incorrect '

 

Guess you like

Origin www.cnblogs.com/linyouyi/p/11409734.html