File = open (' Lock.txt '). ReadLines ()
Name = input (' username: '). Strip ()
Lock=[]
For I in file:
line = I.strip (' \ n ')
Lock.append (line)
If name in Lock:
Print (name, ' already locked, please contact the account Bank. Exit! ')
Else
i = 1
While I <=3:
i = i + 1
Print (' ...... ............)
Username = Name
Print (username)
passwd = input (' passwd: '). Strip ()
f = open (' User.txt ', ' R ')
Login = False
If Len (username)! = 0 and Len (passwd)! = 0:
For line in F.readlines ():
If username = = Line.split () [0] and passwd = = Line.split () [1]:
Print ("Welcome to China Bank AMT system")
Login = True
Break
Else
Continue
If login is True:
Break
Else
f = open (' Lock.txt ', ' a ')
F.write (name)
F.write (' \ n ')
F.close ()
Print (name, ' your password entered more than three, lock account, exit ')
This article is from the "Strong Brother blog" blog, please be sure to keep this source http://listcto.blog.51cto.com/10175308/1640312
Python Write Login interface, enter user name password, authentication successful display welcome message, input error three times lock