测试我写的博客

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
posted @ 2017-10-28 11:33  新手来也  阅读(54)  评论(0)    收藏  举报