Is there a way to interrupt Python?

Alex Farber farber at cpan.org
Fri Mar 17 06:32:37 EST 2000


Hi, 

Michael Hudson wrote:
> Alex Farber <farber at cpan.org> writes:
> > is there a way to interrupt Python when it is executing
> > PyEval_EValCode() or PyRun_*() in an embedding application?
> >
> > I would like to be able to stop it by pressing CTRL-C. Maybe
> > there is a flag or some thread ref. which I could kill somehow?
> 
> Getting a SIGINT sent to the process *should* work, ie. pressing
> ctrl-C should work.

thanks for your reply. Yes, CTRL-C works - my program exits.
The problem is that it is the same process. So I am looking
for a way to interrupt PyEval_EValCode() or PyRun_*()

Regards
Alex



More information about the Python-list mailing list