Is there a way to interrupt Python?

Alex Farber farber at
Fri Mar 17 12:32:37 CET 2000


Michael Hudson wrote:
> Alex Farber <farber at> 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_*()


More information about the Python-list mailing list