[Pythonmac-SIG] sys.exit() functionality

Paul Miller paul@fxtech.com
Tue, 29 Jan 2002 14:32:07 -0600


>In embedded Python - why does sys.exit() quit out of the application that's
>embedding the interpreter?  Is there any way to trap or disregard this?

Can you replace sys.exit with your own function? While you're initializing 
the interpreter, couldn't you just run a string that has a dummy exit 
function and a "sys.exit = my_exit" statement? Similar to how you would 
re-map the stdout and sterr write() calls.


While I've got your ear - are you using MacPython with OS/X, and if so, 
have you found a way to keep the SIOUX console from appearing?

-- 
Paul T. Miller | paul@fxtech.com | http://www.fxtech.com