I have a tkinter application which is divide into many classes(frames in tkinter) the program has become 1000+ lines and now I want to divide it into deferent files can any one guide me how can I achieve this.
my code is like
class tkinterApp(tk.Tk): #this is the class which make navigation pages possible
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
container = tk.Frame(self)
container.pack(side="top", fill="both", expand=True)
self.frames = {}
self.attributes('-fullscreen', True)
for F in (StartPage, connect_page, login_page, signup_page, dashboard_page,trip_page,destination_reached_page):
frame = F(container, self)
self.frames[F] = frame
frame.grid(row=0, column=0, sticky="nsew")
self.show_frame(StartPage)
def show_frame(self, cont):
frame = self.frames[cont]
frame.tkraise()
class StartPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
#some code .....
class connect_page(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
#some page...
#more classes like this ........
I want to divide the pages into different python files and and main class tkinterApp
in different file is this possible if How?