I have a code with this loop:
code = 'for i in range(1,1000):
print(i)'
This code is executed from inside a thread class TestThread:
testThread = TestsThread(self, code, autostart)
testThread.start()
Inside a this thread there an exec: with the code above:
exec(code, globals())
Now I would like stop or pause loop at some point, when an event did fired, something like pause a thread.
Some idea?