How do I stop a Python process instantly from a Tkinter window?

Viewed 3221

I have a Python GUI that I use to test various aspects of my work. Currently I have a "stop" button which kills the process at the end of each test (there can be multiple tests set up to run at once). However, some tests take a long time to run and if I need to stop the test I would like it to stop instantly. My thoughts are to use

import pdb; pdb.set_trace()
exit

But I'm not sure how I would inject this into the next run line of code. Is this possible?

1 Answers
Related