Name "window" is not defined error is coming while executing the mentioned code
def create_window():
window = ctk.CTk()
window.title("CREATE")
window.geometry("1789x760")
create_frame = ctk.CTkFrame(window, width=600, height=300)
create_frame.pack()
create_label = ctk.CTkLabel(create_frame, text="Sample")
create_label.pack()
window.mainloop()
You could try this functional approach:
This would work, however, you would not be able to reuse the
populate_windowfunction easily.This Object Oriented approach would allow for more portability and code reuse: