Relative Content

Tag Archive for pythonmultithreadingclassuser-interface

How do I stop a thread which calls a long running task from another python script?

I want to implement a GUI in which I start a long_running_task with a start button. While the task is running, I animate the status in the GUI. That’s why I use multi-threading and create a thread for animation and the long_running_task in start_task().
Now I want to be able to abort the long_running_task while it’s running. Therefore my start button switches to an abort button (update_button()), which updates a status variable self.running by clicking it.