import linecache
error=0
for j in range(0,3,1):
name = input("账户:")
error_name= linecache.getline("D:\\work1error.txt", 1)
if int(name)==int(error_name):
print("用户被锁定")
error=1
break
else:
for i in range(1,5,1):
the_name = linecache.getline("D:\\work1name.txt", i)
if int(the_name)==int(name):
print("right")
break
if int(the_name) == int(name):
break
else:
print('账户不存在')
if error!=1 and int(the_name) == int(name):
the_pass = linecache.getline("D:\\work1pass.txt", i)
for k in range(0,3,1):
password = input("输入密码:")
if int(the_pass) == int(password):
print("登陆成功")
break
else:
print("密码错误")
if error!=1 and int(the_name) == int(name) and int(the_pass) != int(password):
f=open("D:\work1error.txt",'w')
f.write(name)
f.close()