Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pickle
- import numpy
- username = {"username":"Username", "password":"Password_Again"}
- def login_1():
- print("//////////////////////////////////////////")
- print("////////////////LOG IN////////////////////")
- print("//////////////////////////////////////////")
- UUsername = input("Username: ")
- PPassword = input("password: ")
- commands = input("commands: ")
- file = open ("Username.pickle", "rb")
- username = pickle.load(file)
- if UUsername == username["username"] and PPassword == username["password"]:
- print("you are in ")
- else:
- print("Wrong password try again!!!")
- return login_1()
- if commands == "b" or commands == "back":
- print("returns back to the menu!!!")
- return menu()
- def menU(login):
- if login == 1:
- register()
- elif login == 2:
- login_1()
- def register():
- print("////////////////////////////////////////////////////////")
- print("///////////////////REGISTER/////////////////////////////")
- print("////////////////////////////////////////////////////////")
- print("Register: ")
- print("Note: the max password lenght of the charactare is 20")
- print("and the minimum is 7")
- Username = input("Username: ")
- Password = input("Password: ")
- print("please type the password down again")
- Password_Again = input("Paasword: ")
- file = open("Username.pickle", "wb")
- if len(Password) > 20 and len(Password_Again) > 20:
- print("////////////////////////////////////////////////////////")
- print("///////////////////REGISTER/////////////////////////////")
- print("////////////////////////////////////////////////////////")
- print("you're password have more charactare than maxinum, please re-try")
- return register()
- elif len(Password) < 7 and len(Password_Again) < 7:
- print("////////////////////////////////////////////////////////")
- print("///////////////////REGISTER/////////////////////////////")
- print("////////////////////////////////////////////////////////")
- print("you're password have less charactare than the minimum please re-try again.")
- return register()
- if Password != Password_Again:
- print("////////////////////////////////////////////////////////")
- print("///////////////////REGISTER/////////////////////////////")
- print("////////////////////////////////////////////////////////")
- print("you didn't press the correct password, please re-try again. ")
- return register()
- if Password == Password_Again:
- username['username'] = (Username)
- username['password'] = (Password)
- pickle.dump(username, file)
- file.close()
- print("Registered!")
- return login_1()
- class menu():
- print("Menu:")
- print("1.Register")
- print("2. Log in")
- global login
- login = int(input("press 1-2 to log in or register!!!"))
- menU(login)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement