threads and exception in wxPython

Nick Craig-Wood nick at craig-wood.com
Wed Nov 3 13:30:30 EST 2004


Peter Hansen <peter at engcorp.com> wrote:
>  >>> t = T()
>  >>> t
> <T(Thread-7, started)>
>  >>> asyncexc = ctypes.pythonapi.PyThreadState_SetAsyncExc
>  >>> exc = ctypes.py_object(ValueError)
>  >>> asyncexc(t.id, exc)
>  1
>  >>> thread terminated!
> 
>  >>> t
> <T(Thread-7, stopped)>

On a related subject, I'm trying to forcibly terminate a thread thats
already running.  I don't see any means of doing this in the docs.
Sending it an exception would be ideal.  Is the above the only way of
doing this?

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list