Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Functions start
- import time
- print "==========================="
- print "Welcome to Phoenix Studios!"
- print "==========================="
- print "Enter a username and password"
- username = raw_input("Username: ")
- password = raw_input("Password: ")
- def Main():
- commands = {
- "[INFO]": "Information about developer",
- "[PHOENIX]": "Phoenix Studios information",
- "[VERSION]": "Version of OS",
- "[QUIT]" : "Exit program",
- }
- info = {
- "[INFO]" : "This is software developed and\nmaintained by Junaid Talpur"
- }
- version = {
- "[VERSION]" : "0.9.5"
- }
- print "Welcome in!"
- print "Type 'help' for assistance"
- while True:
- print "\n"
- command = raw_input("Command:")
- if command == "help":
- print "==============[COMMANDS]==========="
- for key in commands:
- print(key + " : " + commands[key])
- print "==================================="
- if command == "info":
- print "==============[INFO]=============="
- for key in info:
- print(info[key])
- print "=================================="
- if command == "version":
- print "==============[VERSION]==========="
- for key in version:
- print(key + " : " + version[key])
- now = time.strftime("%I:%M:%S")
- print "[DATE RELEASED] : 3/27/2017"
- print "[Current date] : " + time.strftime("%x")
- print ("[Current time] : %s" % now )
- print "=================================="
- if command == "quit":
- print "Saving user data..."
- time.sleep(2)
- print "Signing out..."
- time.sleep(1)
- def Welcome():
- print "Welcome in!"
- print "Please enter your login info, to make sure its you"
- username = raw_input("Username: ")
- password = raw_input("Password: ")
- file = open("Login.txt", "r")
- if username and password != "":
- for line in file.readlines():
- line = line.strip()
- if str(line) == username and password:
- Main()
- else:
- print "Register again"
- Register()
- #(2)
- def Pass():
- file = open("Login.txt", "r")
- if username and password != "":
- for line in file.readlines():
- line = line.strip()
- if str(line) == password:
- print "Pass found", line
- Welcome()
- else:
- print "Invalid"
- #(1)
- def Login():
- file = open("Login.txt", "r")
- if username and password != "":
- for line in file.readlines():
- line = line.strip()
- if str(line) == username:
- print "User found", line
- Pass()
- else:
- print "Invalid try again"
- Login()
- file.close()
- Login()
- def Register():
- counter = 0
- list = ['yes','YES','Yes']
- print "[Yes][No]"
- print "User not registered, register now?"
- answer = raw_input(":")
- if answer in list:
- print "Ok"
- counter +=1
- print "Enter login info"
- username = raw_input("Username: ")
- password = raw_input("Password: ")
- file = open("Login.txt", "a")
- print >>file, "[Data]", counter
- print >>file, (username), "\n"
- print >>file, (password), "\n"
- file.close()
- else:
- print "Quitting..."
- Register()
- #(3)
- def Welcome():
- print "Welcome in!"
- print "Please enter your login info, to make sure its you"
- username = raw_input("Username: ")
- password = raw_input("Password: ")
- file = open("Login.txt", "r")
- if username and password != "":
- for line in file.readlines():
- line = line.strip()
- if str(line) == username and password:
- print "User found"
- print line
- else:
- print "Register again"
- Register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement