标签:lease 使用 http 代码 log 退出 style images lock
需求:
流程图:
代码:
1 div={ 2 ‘list1‘:{‘password‘:‘123456‘}, 3 ‘list2‘:{‘password‘:‘123456‘}, 4 ‘list3‘:{‘password‘:‘123456‘}, 5 } 6 f = open(‘black_user‘,‘r‘) 7 lock_file = f.readlines() 8 f.close() 9 count=0 10 count1=0 11 while True: 12 name_input=input("please input name:") 13 if count == 3: 14 print("用户名输入次数到达限制") 15 break 16 if not name_input in div: 17 print("用户名错误") 18 count +=1 19 if name_input in lock_file: 20 print("户名已锁定,暂停使用!") 21 exit() 22 23 if name_input in div: 24 count -=2 25 password_input=str(input("please input password:")) 26 if password_input == div[name_input][‘password‘]: 27 print ("密码成功") 28 break 29 else: 30 print("密码错误") 31 count1 +=1 32 if count1 == 2: 33 print("您输入的密码错误次数已达3次,将锁定您的账户!") 34 f = open(‘black_user‘, ‘w‘) 35 f.write(‘%s‘%name_input) 36 f.close() 37 break
标签:lease 使用 http 代码 log 退出 style images lock
原文地址:http://www.cnblogs.com/wangshaojie/p/7132663.html