Stopping a program

Thomas Philips tkpmep at
Mon Feb 16 04:23:44 CET 2004

A follow up to the question posed above: I discovered sys.exit() and
played around it. I find that it exhibits different behaviors
depending on whether the program is run from IDLE or fron the command
line. In idle, calling sys.exit() gives me a barrage of output that
starts with
Traceback (most recent call lat):
and ends with
SystemExit: 0

after which I get back to the prompt. However, if the program is run
from the command line, the window with the command prompt simply
disappears (most likely after the same barrage flashes across it to
fast for the eye to follow).

Is there a variant of sys.exit() that will exit the program gracefully
to the command prompt in IDLE without bombarding me with information
that I know to be irrelevant?

 Thomas Philips

More information about the Python-list mailing list