Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # v1 Doesn't contain detailed screen (tkinter).
- # Fixing login bugs
- def loop():
- method = input("[R]egister, [L]ogin: ") # R=Register, L=Login
- data = {
- "registers": []
- }
- def register():
- new_register = {
- "username": input("Type your username: "),
- "password": input("Type your password: ")
- }
- data["registers"].append(new_register)
- print("Registration successful!")
- return
- def login():
- username = input("Enter your username: ")
- password = input("Enter your password: ")
- for record in data["registers"]:
- if record["username"] == username and record["password"] == password:
- print("Logged in successfully!")
- return
- print("Invalid username or password.")
- return
- if method.lower() == "r":
- register()
- elif method.lower() == "l":
- login()
- else:
- print("Invalid type!")
- while (True):
- loop()
Advertisement
Add Comment
Please, Sign In to add comment