#!/usr/bin/evn python
#-*-Coding:utf-8-*-
# Author:aron
Import Sys,os
i = 0
While I < 3:
Name = input ("Please enter user name:")
With open (' Account_lock.txt ', ' r+ ') as F:
For N in F:
n = n.strip (' \ n ')
if name = = N:
Sys.exit (' user%s, has been locked out '% name ')
With open (' Username.txt ', ' r+ ') as User_:
For u in User_.readlines ():
(User,password) = U.strip (' \ n '). Split (' = ')
If name = = User:
j = 0
While J < 3:
passwd = input ("Please enter password:")
if passwd = = password:
Print ("Welcome to login management Platform, user%s"% name)
Sys.exit (0)
Else
If J! = 2:
Print ("User%s password is wrong, please re-enter, and%s chance"% (NAME,2-J))
J + = 1
Else
With open (' Account_lock.txt ', ' A + ') as F:
F.writelines ("%s\n"% name)
Sys.exit ("User%s password error 3 times, has been locked please contact the administrator.") ")
Else
Pass
Else
If I! = 2:
Print (' User%s does not exist, please re-enter and%d chance '% (name,2-i))
i + = 1
Else
Sys.exit (' User%s does not exist, exit '% name ')
Python3 Login Interface