标签:print txt and input open password write bre 努力
f = open("username.txt","r")
y = f.read()
#print(y)
f.close()
p = open("password.txt","r")
p1 = p.read()
#print(p1)
p.close()
a = 0
while True:
c = open("cuo.txt","r")
c1 = c.read()
#print(c1)
c.close()
username = input("请输入用户名:")
password = input("请输入密码:")
if username == c1:
print("用户被锁定。。")
break
elif username == y and password == p1 :
print("输入正确")
break
elif a == 2 :
c = open("cuo.txt","w")
c.write(username)
c.close()
else:
print("输入错误-----")
a += 1
标签:print txt and input open password write bre 努力
原文地址:http://www.cnblogs.com/lygzhan/p/7746366.html