with open(‘zhanghaomima‘,‘r‘,encoding=‘utf8‘) as f_read: file_dict = eval(f_read.read().strip()) i=0 while i<3: user = input("username:") password = input("passwd:") if user in file_dict: if file_dict[user]==password: print("登入成功!") break else: print(‘登入失败!‘) i+=1 else: print("账号不存在!请重新输入") if i==3: print("输错三次了,账号%s被锁定"%user) print("退出程序") break