On Mon, May 6, 2013 at 2:24 PM, Jim Mooney <[email protected]> wrote:
> I've noticed that if you exit() a program you always get a traceback message:
> Traceback (most recent call last):
> File "<pyshell#1>", line 1, in <module>
> exit('what now?')
> File "C:\Python33\lib\site.py", line 380, in __call__
> raise SystemExit(code)
>
> What if you just want to exit for some normal reason and don't want
> the message? Or is a program always supposed to end in some normal way
> without an exit. Or is there a different, more graceful way to end a
> program when you want?
Something like this?
>> import sys
>>> while 1:
... sys.exit('Exiting from Infinite Loop')
...
Exiting from Infinite Loop
-Amit.
--
http://echorand.me
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor