It can be done! You just have to build your own
mainloop() function. This is much easier than it sounds. I formerly treated the mainloop as if it were some automagical black box which is aimed once and beyond your control once started. Turns out a mainloop is three lines of code.