Good afternoon, StackOverflow community,
I am a first-time GUI coder seeking advice. I am busy with my MSc in Physical Chemistry, for context.
I have a simple question: Is it considered poor practice to wrap the entirety of my code into a single class? I have tried to split my code up in classes, but I can't seem to get the initialising magic method right when dealing with multiple classes. For reference, I have attached my own init. Maybe you could help me understand how I could possibly split all of this up into different classes, which could go into separate modules.
Thanks!
class ApplicationUI(tk.Tk):
def __init__(self):
"""
Initialises the GUI and parent.
"""
tk.Tk.__init__(self)
self.create_canvas()
self.create_menus()
self.create_main_buttons()
self.data = {}
self.call_counter = 0
self.file_opts = {}
self.file_opts['filetypes'] = [('Text Files', '.txt'),('CSV Files', '.csv'),('All Files', '.*')]
self.file_opts['initialdir'] = 'C:\\Users\xxx\Documents'
self.file_opts['title'] = 'File'
app = ApplicationUI()
app.mainloop()