Re: [Tutor] sys.exit help

2010-08-02 Thread Richard D. Moores
On Mon, Aug 2, 2010 at 13:48, Evert Rol wrote: > (replying to the full list; hope that was intended.) > I was wondering how can I change sys.exit so if you use command line to run the program. it prompts a message asking if the user wants to exit instead of automatically just exit

Re: [Tutor] sys.exit help

2010-08-02 Thread Evert Rol
(replying to the full list; hope that was intended.) >>> I was wondering how can I change sys.exit so if you use command line to run >>> the program. it prompts a message asking if the user wants to exit instead >>> of automatically just exiting? >> >> Just write a wrapper exit() function aroun

Re: [Tutor] sys.exit help

2010-08-01 Thread Alan Gauld
"Jason MacFiggen" wrote I was wondering how can I change sys.exit so if you use command line to run the program. it prompts a message asking if the user wants to exit instead of automatically just exiting? Don't just use sys.exit use a try/except SystemExit... import sys try: ...sys.

Re: [Tutor] sys.exit help

2010-08-01 Thread Steven D'Aprano
On Mon, 2 Aug 2010 06:26:24 am Jason MacFiggen wrote: > I was wondering how can I change sys.exit so if you use command line > to run the program. it prompts a message asking if the user wants to > exit instead of automatically just exiting? Don't do that. Leave sys.exit alone, write your own quit

Re: [Tutor] sys.exit help

2010-08-01 Thread Evert Rol
> I was wondering how can I change sys.exit so if you use command line to run > the program. it prompts a message asking if the user wants to exit instead of > automatically just exiting? Just write a wrapper exit() function around sys.exit that does that. You don't want to change the sys.exit f

Re: [Tutor] sys.exit help

2010-08-01 Thread Hugo Arts
On Sun, Aug 1, 2010 at 10:26 PM, Jason MacFiggen wrote: > I was wondering how can I change sys.exit so if you use command line to run > the program. it prompts a message asking if the user wants to exit instead > of automatically just exiting? You can't change sys.exit, but you can build somethin