标签:交互式 nbsp == usr com user 密码 weight utf-8
交互式输入,判断用户名密码是否匹配
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jean
import getpass
users = "jean"
passd = "123456"
username = input("username: ")
#password = input("password: ")
password = getpass.getpass("password: ")
if username == users and password == passd:
print("Welcome {name} login..".format(name=username))
else:
print("Invliad user or password..")
标签:交互式 nbsp == usr com user 密码 weight utf-8
原文地址:http://www.cnblogs.com/liuyibai/p/7143428.html