You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I was replacing tk message box with CTkMessagebox but when I ran the code and tested it, the messagebox instantly closed
password = self.teachers_password_signup.get()
confirm = self.teachers_confirm_password_signup.get()
username = self.teachers_username_signup.get()
name = self.teachers_name_signup.get()
if (name or username or confirm or name) == "":
CTkMessagebox(title="Error", message="Please fill out the form!", icon="OK")
elif password == confirm:
with open("data/teachers.txt", "a") as file:
data = f"{username}:{password}:{name}"
file.write(data)
file.write("\n")
CTkMessagebox(title="Sign Up Successful",message=f"Sign Up successful! Please return to the login site.",icon="check", option_1="OK")
else:
CTkMessagebox(title="Error", message="Passwords don't match", icon="OK")
def students_login_event(self):
password = self.students_password_login.get()
username = self.students_username_login.get()
if (username or password) == "":
CTkMessagebox(title="Error", message="Please fill out the form!", icon="OK")
else:
CTkMessagebox(title="Error", message="Password dont't match", icon="OK")
with open("data/students.txt","r") as file:
data = file.readline()
saved_username ,saved_password, name = data.strip().split(":")
if saved_username == username and saved_password == password:
CTkMessagebox(title="Login Successful",message=f"Login successful! Welcome {name} to the app!",icon="check", option_1="OK")
def teachers_login_event(self):
password = self.teachers_password_login.get()
username = self.teachers_username_login.get()
if (username or password) == "":
CTkMessagebox(title="Error", message="Please fill out the form!", icon="OK")
else:
CTkMessagebox(title="Error", message="Password dont't match", icon="OK")
with open("data/teachers.txt","r") as file:
data = file.readline()
saved_username ,saved_password, name = data.strip().split(":")
if saved_username == username and saved_password == password:
CTkMessagebox(title="Login Successful",message=f"Login successful! Welcome {name} to the app!",icon="check", option_1="OK")
def admins_login_event(self):
password = self.admins_password_login.get()
username = self.admins_username_login.get()
if (username or password) == "":
CTkMessagebox(title="Error", message="Please fill out the form!", icon="OK")
else:
CTkMessagebox(title="Error", message="Password dont't match", icon="OK")
with open("data/admins.txt","r") as file:
data = file.readline()
saved_username ,saved_password, name = data.strip().split(":")
if saved_username == username and saved_password == password:
CTkMessagebox(title="Login Successful",message=f"Login successful! Welcome {name} to the app!",icon="check", option_1="OK")
The text was updated successfully, but these errors were encountered:
So I was replacing tk message box with CTkMessagebox but when I ran the code and tested it, the messagebox instantly closed
The text was updated successfully, but these errors were encountered: