Python login interface design, python login interface
I just started learning Python, the first program written.
Import osuser_file = comment ', 'R') user_list = user_file.readlines () user_file.close () while True: lock_file = comment', 'r + ') lock_list = lock_file.readlines () lock_file.close () login_Success = False user_name = input ('user :'). strip () for line1 in lock_list: line1 = line1.split () if user_name = line1 [0]: print ("Sorry, you are already in the block list, get the fucking out! ") Exit () for line2 in user_list: line2 = line2.split () if user_name = line2 [0]: for I in range (3): password = input ('password: '). strip () if password = line2 [1]: print ("Welcome % s login my system! "% User_name) login_Success = True break else: f = open('lock_file.txt ', 'A') f. write ('% s \ n' % user_name) f. close () print ("Entered 3 times of wrong passwd, going to lock % s" % user_name) if login_Success = True: break if login_Success = True: breakView Code