[Python/C API] How to break a script execution ?
herrmisiek at precz.ze.spamem.wp.pl
Thu Jan 16 18:56:35 CET 2003
I have written a MFC application that allows to run Python's scripts with
using Python/C API. All works perfectly, but I don't know how to break a
script execution on demand (something like pressing Ctrl+C in Python).
Suppose I have a script that simply execute an endless loop and I would like
to stop it execution by clicking a button in my application and then dump to
my application an iteration count. Here is an example script:
i = 0
i = i + 1
print "Iteration: ", i
Is there any possibility to break a script execution from my application and
catch the exception? How to do it? I would be grateful for any
More information about the Python-list