[PYTHON] user logon is locked due to three logon errors and python User Logon fails.
1 #-*-coding: UTF-8-*-2 # Three logon errors: locking users 3 4 # blacklisted users, whitelist users, whitelist User Password 5 with open('black_user.txt ', 'R') as f, \ 6 open('real_username.txt', 'R') as u, \ 7 open('real_password.txt ', 'R ') as p: 8 lock_file = f. read (). strip () 9 user_list = u. read () 10 pass_list = p. read () 11 12 username = input ('Please input your name: ') 13 14 for I in range (1): 15 if lock_file = username: 16 print ('Sorry, your name has B Een locked, please contact your administrator ') 17 exit () 18 elif user_list! = Username: 19 print ('You input username invalid. ') 20 exit () 21 22 # used for counting (for three cycles) 23 count = 024 for i2 in range (3 ): 25 password = input ('Please input your password: ') 26 if password = pass_list: 27 print ('login successfully') 28 exit () 29 else: 30 print ('login failed') 31 count + = 132 33 if count = print ("Your username has been locked, please you will contact your administrator. ") 35 f = open('black_user.txt ', 'A') 36 f. write ('% s \ n' % username) 37 f. close ()