[Pythonmac-SIG] can't exit module

John Precedo johnp@reportlab.com
Fri, 8 Dec 2000 18:45:27 -0000


Chris Barker said:
> Jack Jansen wrote:
>> You're right: sys.exit() doesn't work in the IDE. In the
raw interpreter it
>> works fine, and indeed exits the interpreter, but in the
IDE it is unclear
>> what it should do.
>>
>> On the one hand exiting the IDE is a possible solution,
and seems to be
>> what you expected. On the other hand exiting may not be
what you want...
[SNIP]
>
> 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
behaviour
> depending on whether a script is run from the IDE or not.
This
> continually is causing problems like this one.

Personally, I find the way that the IDE behaves pretty
sensible. It does behave in the same way as the interpreter
most of the time. And when it doesn't, it seems to have a
good reason.

I would rather have one long session in the IDE, with it
stopping the program running and giving me a message telling
me it had hit a sys.exit() call, rather than having to keep
starting and re-starting the IDE every time the program
ended. That strikes me as a waste of time - and I'd be
complaining about the how annoying it would be if actually
did act like that.

If I really _want_ it to die at the sys.exit call, I run it
from the interpreter anyway. When I want to see exactly what
happens when a program runs in the interpreter, I run it in
the interpreter. Seems to make perfect sense to me! :o)

> I am I really the only one who thinks this is a problem?

Maybe not the only one. But it doesn't bother me.

The thing that does bother me is the way it behaves when you
use a "raw_input". That little pop-up box that appears for
you to type your text into is plain _annoying_! I find that
when I write a program that needs a lot of keyboard input, I
test it from the interpreter, and just use the IDE as a
glorified word processor to enter the programs with.

In this case, I think it would have made a lot more sense to
have a window that both displays output and allows you to
type text in (in the same way the it does when your run it
in the interpreter).

Oh well, the GUI isn't perfect, but the fact that sys.exit
doesn't kill it doesn't really bother me.

Anyone else have anything that bugs them about it?

--
John Precedo   (johnp@reportlab.com)
Junior Developer,   Reportlab, Inc