I'm using python 3 / tkinter if that matters.
In looking at code samples I noticed that the main loop is typically in the GUI part of the code, and the rest of the code provides callbacks for GUI to call when needed.
But my simulation runs independently of the user interaction; the UI is there to provide a view, from time to time, into what's going on in the simulation, but it doesn't control what goes on in the simulation. So I would like the main loop to be concerned with the simulation rather than UI. How would I do that?
Write your own main loop that calls the functions that check for and process GUI events.
Can the main loop of a program be moved out of GUI?