[Pythonmac-SIG] can't exit module

Jack Jansen jack@oratrix.nl
Sun, 10 Dec 2000 22:50:52 +0100


Recently, Chris Barker <cbarker@jps.net> said:
> ARRGG! once again, a problem arising from the fundamental flaw of the
> IDE: it uses the same interpreter to run itself as the scripts you are
> running. This means that you are forced to have different behavior
> depending on whether a script is run from the IDE or not. This
> continually is causing problems like this one. We really need a way to
> run a script from the IDE and have it behave exactly like running it
> from the raw interpreter.

No, I don't think this is the problem here. The problem is that the
semantics of "sys.exit()" are "terminate program". And, if you're
running in an IDE, there's a question of what "program" you mean: the
script that's running or the IDE. If you chose one of these there's
bound to be someone who expects the other behaviour.

All that said I think there's definitely a good reason to have IDE
optionally use an external interpreter to do the actual work, but it
is just such an incredible amount of work to do it right. Not only do
you want stdin/stdout/stderr to be routed correctly, but you'll also
need stubs in the work-interpreter to allow the debugger and the
browser to work, etc. And the machinery needed to implement all this
in the work-interpreter may well have such an impact that you still
can't really run Tkinter scripts:-(

The good news is that once you've done this you get remote debugging
and other goodies (like using IDE to run Python scripts on your
Windows-PC, and who knows what more) for free.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm