Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- counter = 0
- def validation():
- global counter
- print("Sorry, this username or password does not exist please try again")
- counter += 1
- if counter == 3:
- print("----------------------------------------------------")
- print("You have been locked out please restart to try again")
- sys.exit()
- def verify_login(username, password, login_data):
- for line in login_data:
- if ("username: " + username + " password: " + password) == line.strip():
- return True
- return False
- check_failed = True
- while check_failed:
- with open("accountfile.txt","r") as username_finder:
- print("Could player 1 enter their username and password")
- username1=input("Please enter your username ")
- password1=input("Please enter your password ")
- if verify_login(username1, password1, username_finder):
- print("you are logged in")
- def verify_login(username, password, login_data):
- for line in login_data:
- hsh, _, username_from_file, _, password_from_file = line.strip().split()
- if len(hsh) == 32 && username == username_from_file and password == password_from_file:
- return True
- return False
Add Comment
Please, Sign In to add comment