From NumPy import*
classcount={}
lock_name=[]
passdate=[]
namedate=[]
Fr1=open (' User.txt ')
For line in Fr1.readlines ():
Linearr=line.strip (). Split ()
Namedate.append (linearr[0])
Passdate.append ( LINEARR[1])
Namedate=list (namedate)
Passdate=list (passdate)
M=shape (namedate) [0]
While 1:
fr2= Open (' Lock_name.txt ')
for line in Fr2.readlines ():
Lock_name.append (line)
N=shape (Lock_name) [0]
Username=input (' Username: ')
Password=input (' PassWord: ')
for I in Range (n):
If username==lock_name[i]:
Print (' This count is locked ')
break
for J in Range (m):
If USERNAME==NAMEDATE[J] and PASSWORD==PASSDATE[J]:
print (' welcome enter ')
Break
Else:
Classcount[username]=classcount.get (username,0) +1
If classcount[ USERNAME]>2:
Print (' This count is locked ')
FR2 = open (' Lock_name.txt ', ' W ')
Fr2.write (Username)
Fr2.close
Break
Else:
Print (' Please input again ')
Break
# # #流程图
---------Enter the user name and password first
--------compared to an already locked account
------------------------Y, the output account is locked.
------------------------N is the comparison between the user name and the password in the file
--------------------------------Y Output Welcome to enter
-------------------------------N to determine if the number of entries for the account is greater than 3 times
---------------------------------------------Y Lock the account and write the account to the lock file
---------------------------------------------N Please re-enter your account and password
Python Simple Login interface