Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import sys
- from time import sleep
- def reading(username): #defining reading for reading the files inputed by the user.
- print(">>>READING FILES<<<") #Just creating an enviroment that the system is reading the files
- time.sleep(2)
- print("Please Wait for a moment while reading files..")
- time.sleep(5)
- print("Files are ready")
- print("........ ")
- time.sleep(1)
- print("........ ")
- time.sleep(2)
- print("type the code of the course you want to read")
- time.sleep(.7)
- print("What Course you Want to read? [01.BET-COET |02. BSIE-IA |03. BSIE-ICT]| 04. exit") #Printing the options / codes to be used by the user
- while True:
- options = input(username + ":") #Asking for what options the user want either 01,02,03.
- if options == "01":
- print("Reading")
- time.sleep(2)
- print("BET-COET")
- coet()
- elif options == "02":
- print('Reading')
- time.sleep(2)
- print("BSIE-IA")
- ia()
- elif options == "03":
- print("Reading")
- time.sleep(2)
- print("BSIE-ICT")
- ict()
- elif options == "04":
- print("EXITING.")
- time.sleep(3)
- session(username)
- else:
- print("error, you didn't input the correct code.") #Error if the user didn't follow the code
- time.sleep(1.2)
- def delete(username):
- while True:
- print("n"," Which Course you want to clear? |i. BET-COET| ii. BSIE-IA| iii. BSIE-ICT|(type exit if you want to exit)|") # Deleting student's name
- print("Input The Correct Code of the Course You Want to Clear")
- options = input(username + ":")
- if options == "i".lower():
- print("Deleting")
- time.sleep(2)
- file = open("coet.txt", "w")
- file.write(" ")
- file.close()
- time.sleep(.5)
- print("DELETED")
- time.sleep(.5)
- elif options == "ii".lower():
- print("Deleting")
- time.sleep(2)
- file = open("IA", "w")
- file.write(" ")
- file.close()
- time.sleep(.5)
- print("DELETED")
- time.sleep(.5)
- elif options == "iii".lower():
- print("Deleting")
- time.sleep(2)
- file = open("ICT", "w")
- file.write(" ")
- file.close()
- time.sleep(.5)
- print("DELETED")
- time.sleep(.5)
- elif options == "exit".lower():
- time.sleep(2)
- print("Exiting")
- time.sleep(1)
- session(username)
- return True
- else:
- print("ERROR YOU DIDN'T INPUT THE CORRECT CODE")
- time.sleep(1.2)
- def coet(): #defining BET-CoET as a module to call to read the file inputed.
- try:
- file = open("coet.txt", 'r')
- data = file.readlines()
- file.close()
- for line in data:
- print(line)
- except:
- print("Error. You didn't input any students in BET-CoET")
- def ia(): ##defining BSIE-IA as a module to call to read the file inputed.
- try:
- file = open("IA", 'r')
- data = file.readlines()
- file.close()
- for line in data:
- print(line)
- except:
- print("Error. You didn't input any students in BSIE-IA")
- def ict(): ##defining BSIE-ICT as a module to call to read the file inputed.
- try:
- file = open("ICT", 'r')
- data = file.readlines()
- file.close()
- for line in data:
- print(line)
- except:
- print("Error. You didn't input any students in BSIE-ICT")
- def register(): #Registering as a new user
- print("WELCOME")
- print("Please Register your Account")
- time.sleep(1)
- print("No SPACING in the account register available is only (_*Under-score,-*Hyphen)")
- time.sleep(1)
- username = input("Please Input Your Desired username: ")
- password = input("Please input your desired password: ")
- file = open("accountfile.txt","a")
- file.write(username)
- file.write(" ")
- file.write(password)
- file.write("n")
- file.close()
- if login():
- print("You are now logged in...")
- def login(): #Logging in by using the saved credentials
- tries = 3 #creating a limiter, in case that the user is trolling in logging on his/her account
- while tries != 0:
- tries -= 1 # Decrementation
- time.sleep(1)
- print(" Welcome User! Please Login to your Account")
- username = input("Please enter your username:")
- password = input("Please enter your password:")
- for line in open("accountfile.txt", "r").readlines(): # Read the lines
- login_info = line.split() # Split on the space, and store the results in a list of two strings
- if username == login_info[0] and password == login_info[1]:
- print("Correct credentials!")
- session(username)
- return True
- print("Access Denied", + tries, "Tries Left")
- if tries == 0:
- print("You Have Entered incorrect credentials 3 times", "n", "exiting")
- time.sleep(2)
- start()
- return False
- def session(username):
- global students
- global ns
- print("Welcome to your account " + username)
- print("Type The code of options you want to pick")
- time.sleep(.8)
- print(" Options:|1.course read|2. course input new students| 3. Delete all information |4. logout"), "n"
- while True:
- option = input(username + ":")
- if option == "4":
- print("Logging out...")
- time.sleep(1.5)
- print('Logout Complete')
- time.sleep(1)
- start()
- if option == "2":
- print("What Course you Want to add? [a.BET-COET |b. BSIE-IA |c. BSIE-ICT]") #asking what course the user want to add
- option = input(username + ":")
- while True:
- if option == "a".lower():
- print("BET-COET PICKED!", "n", "Reminder! | Type 'exit' if you want to exit")
- while True:
- students = input("Please Input your Student's Name: ")
- if students == "exit".lower():
- print("Exiting..")
- session(username)
- ns = input("Non Stem | Stem: ")
- if ns == "exit".lower():
- print("Exiting..")
- session(username)
- else:
- dict = {}
- file = open("coet.txt", "a+")
- dict["Student's Name"] = students
- dict["Non Stem | Stem"] = ns
- file.write(str(dict) + "n")
- file.close()
- elif option == "b".lower():
- print("BSIE-IA PICKED!", "n", "Reminder! | Type 'exit' if you want to exit")
- while True:
- students = input("Please Input your Student's Name: ")
- if students == "exit":
- print("Exiting..")
- session(username)
- ns = input("Non Stem | Stem: ")
- if ns == "exit":
- print("Exiting..")
- session(username)
- else:
- dict = {}
- file = open("IA", "a+")
- dict["Student's Name"] = students
- dict["Non Stem | Stem"] = ns
- file.write(str(dict) + 'n')
- file.close()
- elif option == "c".lower():
- print("BSIE-ICT PICKED!", "n", "Reminder! | Type 'exit' if you want to exit")
- while True:
- students = input("Please Input your Student's Name: ")
- if students == "exit":
- print("Exiting..")
- session(username)
- ns = input("Non Stem | Stem: ")
- if ns == "exit":
- print("Exiting..")
- session(username)
- else:
- dict = {}
- file = open("ICT", "a+")
- dict["Student's Name"] = students
- dict["Non Stem | Stem"] = ns
- file.write(str(dict) + 'n')
- file.close()
- elif option == "1":
- reading(username)
- elif option == "3":
- delete(username)
- def main():
- hp = ("****WELCOME****") #The VERY START OF THE PROGRAM
- for char in hp: #Adding some cool things in the program to make it creative
- sleep(.1)
- sys.stdout.write(char)
- sys.stdout.flush()
- print("n", "Student's Checklist V1.0 :IHG VERSION") #credits to the one who help me! "IVAN HAYZ GONZALES"
- time.sleep(1.2)
- start() #Calling the Module Found
- def start():
- stop = 3 # Limit the user on how he can troll
- while stop != 0:
- stop -= 1
- userchoice = input("New User? Y/N?").lower()
- if userchoice == "y":
- register()
- elif userchoice == "n":
- login()
- break
- else:
- print("ERROR. Please enter again", + stop, "Tries Left")
- main()
Add Comment
Please, Sign In to add comment