If you are talking about events and all that, I suppose you are using (or should be using) threads.
Why don't try running the length_function as a Thread that on every loop checks a semaphore and if the condition is met, exits itself? Kinda like this: http://mail.python.org/pipermail/python-list/2006-January/362138.html HTH, Sergio PS: Note the "try..." in my reply. I've never done this, so I'm not sure it's going to work. Wiser people in the list will probably give you better replies. On Nov 22, 2007 11:30 PM, Sorin Schwimmer <[EMAIL PROTECTED]> wrote: > Hi All, > > We all know that a function can launch the execution > of another function. How can a function stop the > execution of another function? > > For instance, lenghty_function() executes, when an > external event triggers cancel(), which is supposed to > abruptly stop lengthy_function(), reset some variables > and exit immediately. > > Thanks for your advice > SxN > > > > ____________________________________________________________________________________ > Be a better sports nut! Let your teams follow you > with Yahoo Mobile. Try it now. > http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list