Re: [Tutor] exit message

2013-05-06 Thread Steven D'Aprano
On Sun, May 05, 2013 at 09:24:30PM -0700, Jim Mooney wrote: > I've noticed that if you exit() a program you always get a traceback message: Which exit are you talking about? There is sys.exit, and there is also the interactive exit() function defined by the site module for interactive use. >

Re: [Tutor] exit message

2013-05-06 Thread Alan Gauld
On 06/05/13 05:24, Jim Mooney wrote: I've noticed that if you exit() a program you always get a traceback message: Traceback (most recent call last): File "", line 1, in exit('what now?') File "C:\Python33\lib\site.py", line 380, in __call__ raise SystemExit(code) Only within I

Re: [Tutor] exit message

2013-05-06 Thread eryksun
On Mon, May 6, 2013 at 1:12 AM, Zachary Ware wrote: > If you don't care about the exit code, you can just "drop off" the end > of the script. If you don't end with an unhandled exception, your > exit code will be 0, otherwise it will (probably) be 1. You can also exit with a message and an exit

Re: [Tutor] exit message

2013-05-05 Thread Zachary Ware
On Sun, May 5, 2013 at 11:24 PM, Jim Mooney wrote: > > I've noticed that if you exit() a program you always get a traceback message: > Traceback (most recent call last): > File "", line 1, in > exit('what now?') > File "C:\Python33\lib\site.py", line 380, in __call__ > raise SystemExi

Re: [Tutor] exit message

2013-05-05 Thread Amit Saha
On Mon, May 6, 2013 at 2:56 PM, Jim Mooney wrote: >> Something like this? >> import sys > while 1: >> ... sys.exit('Exiting from Infinite Loop') >> ... >> Exiting from Infinite Loop > > I still get a traceback message from the console. I just want a clean > exit without that. I have a

Re: [Tutor] exit message

2013-05-05 Thread Jim Mooney
> Something like this? > >>> import sys while 1: > ... sys.exit('Exiting from Infinite Loop') > ... > Exiting from Infinite Loop I still get a traceback message from the console. I just want a clean exit without that. I have a feeling I'm thinking about something the wrong way ;') Traceb

Re: [Tutor] exit message

2013-05-05 Thread Amit Saha
On Mon, May 6, 2013 at 2:24 PM, Jim Mooney wrote: > I've noticed that if you exit() a program you always get a traceback message: > Traceback (most recent call last): > File "", line 1, in > exit('what now?') > File "C:\Python33\lib\site.py", line 380, in __call__ > raise SystemExit(c

[Tutor] exit message

2013-05-05 Thread Jim Mooney
I've noticed that if you exit() a program you always get a traceback message: Traceback (most recent call last): File "", line 1, in 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