PYTHON最基本的登录脚本

import getpass

_username = 'wu'
_password = 'wu123'
username = input("username:")
#password = getpass.getpass("password:") #密文输入
password = input("password:")

if _username == username and _password == password:
print("Welcon user {name} login... ".format(name=username)) #直接花括号定义了一个name变量?
else:
print("Invalid username or password!")

#print(username,password)
posted @ 2018-04-25 08:58  无所住心  阅读(351)  评论(0编辑  收藏  举报