def student_create(event=None): name = prompt.get() ID = StudentID pop.destroy() popup_hello('Hello ' + name) svc.create_student(ID, str(name)) svc.log_into_account(StudentID)
def student_create(event: object = None): name = prompt.get() ID = StudentID if isint(name) == False: student = svc.create_student(ID, str(name)) svc.log_into_account(StudentID) message = "Hello " + name popup_message(message, window) pop.destroy()
def login(): while True: studentID = input( 'What is your Student ID? ([q] to exit): \n').strip().lower() studentID = str(studentID) if studentID == 'q': break # Check that the entered ID is 8 digits long. Not foolproof, but better than nothing if len(studentID) == 8: svc.log_into_account(studentID) else: print( f"\n oops, {studentID} is not a valid Student ID, please check spelling and try again" )
def student_create(event: object = None): name = prompt.get() for n in name: if n.isalnum() or (n == ' '): pass else: Label(pop, text='Special Characters Not allowed!', fg='red').grid(row=5, column=0) return ID = StudentID if isint(name) == False: student = svc.create_student(ID, str(name)) svc.log_into_account(StudentID) message = "Hello " + name popup_message(message, window) pop.destroy()
def login(event=None): StudentID = e.get() if not len(StudentID) == 8: return else: message = log_into_account(StudentID) if message == f"No student with ID {StudentID}": popup_create_student(str(StudentID)) else: popup_hello(message) e.delete(0, END)
def login(*args, **kwargs): StudentID = entry.get() entry.delete(0, END) if not (((len(StudentID) == 8) | (len(StudentID) == 6)) and isint(StudentID)): return else: message, loggedIn = log_into_account(StudentID) if message == f"No student with ID {StudentID}": popup_create_student(str(StudentID), window, master) else: if loggedIn: popup_message(message, window) else: student = svc.find_student_by_studentID(StudentID) popup_message(message, window)