1 #密文输入 2 import getpass 3 import string 4 5 _username = "陈奎元" 6 _password = "123aaa" 7 username = input("UserName:") 8 password = getpass.getpass("PassWord:") 9 #getpass在pycharm中不好用,可以用cmd环境试验 10 if _username == username and _password == password: 11 print("Welcome {username} logoin".format(username=username)) 12 print(f"Welcome {username} logoin") 13 else: 14 print("invalid username and password!")
原文地址:https://www.cnblogs.com/skings/p/10260991.html
时间: 2024-10-22 09:19:16