[Idle-dev] Re: [Tutor] How to interrupt in IDLE (fwd)

Guido van Rossum guido@python.org
Tue, 09 Apr 2002 22:13:33 -0400


> Hi everyone,
> 
> Roman Suzuki from Python-tutor recently discovered that Ctrl-C
> doesn't work in IDLE if the system is busy-waiting.  I'm forwarding
> his post here.

Thanks.  Unfortunately, there's no real easy way out of this.
The ^C can only be detected by Tkinter's event loop, and that isn't
active when the Python VM is executing code, only when it's asking for
input or printing output.

There's some code you can enable that will catch ^C, but it slows
everything down tremendously.  Try to uncomment the ## lines in
beginexecuting() and endexecuting() in PyShell.py.  But I haven't
tried this in years, to it may be broken.

--Guido van Rossum (home page: http://www.python.org/~guido/)