[Tkinter-discuss] How to automatically run some code upon GUI startup?
fredrik at pythonware.com
Tue Apr 8 19:01:25 CEST 2008
> I have created a simple Tkinter GUI. I have a function that needs to be
> executed automatically upon launching the GUI application. How can it be
how about calling it from the script that creates the GUI, before you
enter the mainloop?
if you want to call it when the GUI is up and running, you can use the
"wait_visibility" method on the root widget:
root.wait_visibility() # run event loop until window appears
another approach is to use the "after_idle" method:
More information about the Tkinter-discuss