[Tutor] sys.exit help

Steven D'Aprano steve at pearwood.info
Sun Aug 1 22:40:20 CEST 2010


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() function that 
asks the user and then calls sys.exit if they say yes.


-- 
Steven D'Aprano


More information about the Tutor mailing list