Skip to content
Advertisement

Python GUI Tkinter how to stop a script after pressing Start button

im new to programming in python but i made a simple GUI using Tkinter that has two Buttons, Start and Quit. When i press the Start button, the GUI freezes and i cant press the Quit button anymore … how can i fix that ?

JavaScript

Advertisement

Answer

You could try running your running function in its own thread so it doesn’t block the main thread

JavaScript

Then modify your button to call the run_thread() function instead

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement