Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def login():
- logstart = input("Do you have an account? ").lower()
- if logstart == "yes":
- while True:
- username = input("Enter your username: ")
- password = input("Enter your password: ")
- if username in logins:
- if logins[username] == password:
- return username
- else:
- print("Your password is incorrect.")
- else:
- print("That doesn't exist, try again.")
- elif logstart == "no":
- while True:
- username = input("Please create a username: ")
- password = input("Please create a password: ")
- confirm = input("Confirm password: ")
- if username in logins:
- print("Sorry this already exists.")
- break
- else:
- logins[username] = password
- log = open("logins.pkl", "wb")
- pickle.dump(logins, log)
- log.close()
- break
- else:
- print("That is not the correct input")
- print("")
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement