2011/9/15 r houtman <rl_houtman@yahoo.com>
Hi Pierre,

Thanks for the idea's.
Since the PythonInterpreter was already running in a separate thread, i indeed only needed issue interrupt() to the thread.
Then Jython exits the execution with the next exception;
Traceback (most recent call last):
  File "C:/someDir/someCode.py", line 41, in <module>
KeyboardInterrupt: interrupted sleep

As it shows, the python code always exits at the sleep() command.
This is quite handy, since the python coder can put in time.sleep() calls at places where he wants the code to be able to abort.

Kind regards,

Hi R,

I suggest that you share a common object with the thread. Then in your thread, you can check if its state means that it is time to stop.

Pierre Thibault

Python Developer/Développeur Python
Montréal, QC