[Tutor] Use flag to exit?

Richard D. Moores rdmoores at gmail.com
Fri Jun 25 03:35:40 CEST 2010

On Thu, Jun 24, 2010 at 17:06, Alan Gauld <alan.gauld at btinternet.com> wrote:
> "Richard D. Moores" <rdmoores at gmail.com> wrote
>> I think I much prefer accomplishing an exit by a function return, as I
>> do in <http://tutoree7.pastebin.com/QtAAtATd>, but if I wanted to use
>> sys.exit() in a script (but not in a function) I run inside IDLE or
>> Wing, how do I suppress the message? I'd just like to get that nailed
>> down.
> You can catch it like any other exception but that's not really the point.
> IDLE is not intended to run programs it's for developing them. It is set
> up to catch keyboard interrupts and sys exits deliberately because
> that's what you want in a development tool. Just run the programs
> outside IDLE and they won't get caught and you won't get error
> messages.

But I usually prefer to run the programs I write in an IDE's shell,
unless they are GUI's, of course. What are my options for running my
scripts outside of an IDE? The Windows' command line is pretty ugly
and inconvenient. Copy and pasting is a PITA. And all that changing of
directories. I did enjoy using IPython, however.


More information about the Tutor mailing list