Killing threads

VUG plugin at
Thu Feb 28 12:11:48 CET 2002

Hi all. I'm doing an application in C who needs to execute simultaneous
Pythons scripts. Under certain conditions I need to kill one threads. ¿How
can I do it? For example, I have the following module:

def func1():

def func2():

def func3():
Then, from de application in C I load the previous module and run one of the
functions as a thread, like this:

// Load the module
PyRun_SimpleString("import thread");
PyRun_SimpleString("from module import *");
// Launch some threads

So.... How can I from the C code KILL one of the threads I have started?. I
know that I can use the exit() function from the thread but I need the user
who create these functions doesn't have to put this kind of code inside
their functions.

Thanks in advance

More information about the Python-list mailing list