Mar-14-2022, 03:54 PM
Multiple windows in a GUI has fallen out of favor and most designs have one window with a way to move between multiple views.
In tkinter you can have multiple top level windows but only one root/main window. The root window is made by calling Tk(). This creates a window and initializes the event loop. Additional top level windows are made using TopLevel(). When you exit the root window you exit Tk and all the other top level windows close automatically.
I don't understand your "first experiment". Are your running multiple Python executables, multiple threads, multiple processes? You can only run one mainloop() and you can only create one root window in Python. How are you running these independent windows?
In tkinter you can have multiple top level windows but only one root/main window. The root window is made by calling Tk(). This creates a window and initializes the event loop. Additional top level windows are made using TopLevel(). When you exit the root window you exit Tk and all the other top level windows close automatically.
I don't understand your "first experiment". Are your running multiple Python executables, multiple threads, multiple processes? You can only run one mainloop() and you can only create one root window in Python. How are you running these independent windows?