Jul-20-2017, 03:37 PM
Well, that was a bit of a mess
, lets see if we can partially fix it a bit.

# School Register import time # Python loves lower case function names def create(): # Using this method, Python will close the file automatically with open("SchoolRegister.txt", "w") as file: reg_create = input("Please enter the people present\n") file.write(reg_create) def access(): # Using this method, YOU must close the file file = open("SchoolRegister.txt", "r") print(file.read()) file.close() def leave(): print("Thank you for using SchoolReg, goodbye!") time.sleep(3) quit() def menu(): print(""" Welcome to SchoolReg 1.Create Register 2.Access Register Press 'Q' to quit""") opt = input(" Please select an option: ") if opt == '1': create() elif opt == '2': access() elif opt == 'Q': # Python does NOT love using it's keywords, such as 'quit' leave() return menu()
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition