Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- #Variables
- FileName = "Password.txt"
- #Functions
- def Begin():
- a = raw_input("What would you like to do?: ").lower()
- if(a == "login"):
- Login()
- elif(a == "create"):
- Create()
- else:
- Error()
- def Login():
- if(os.path.isfile(FileName)):
- nUser = "usr" + raw_input("Username: ").lower()
- nPass = "pass" + raw_input("Password: ").lower()
- iLogin = open(FileName, "r")
- # if(iLogin.search(nUser + nPass)):
- # print("Thank you for loggin in.")
- # return 0
- # for line in iLogin:
- # LoginInformation = line
- # break
- # if(LoginInformation.search(nUser + nPass)):
- # print("Thank you for logging in.")
- # return 0
- Error()
- def Create():
- if(os.path.isfile(FileName)):
- print("You already have an account. Delete Password.txt to create a new one.")
- Begin()
- Pass = open(FileName, "w")
- b = raw_input("Username: ").lower()
- c = raw_input("Password: ").lower()
- Pass.writelines("usr" + b + " , " + "pass"+ c)
- Pass.close()
- return 0
- def Error():
- print("You have entered an invalid response.")
- Begin()
- #Program
- print "Login or create an account below."
- Begin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement