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
(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
"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.
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
> 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
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