加密密码:
import getpass
username = input("username:")
password = getpass.getpass("password:")
print(username,password)
用户名和密码判断:
_username = 'alex'
_password ='abc123'
username = input("username:")
password = input("password:")
if _username == username and _password == password:
print("Welcome user {name} login..." .format(name=username))
else:
print("Invalid username or password!")
----------------------------------------------------------