aborting without killing the python interpreter

Erik Max Francis max at alcyone.com
Sun Feb 19 01:43:28 EST 2006


Terry Reedy wrote:

> How?  In the standard interpreter, 'exit' is bound to the string
> 'Use Ctrl-Z plus Return to exit.'
> so trying to call it as a function fails.

I'm _presuming_ there was a hidden `from sys import *` in there.  Hence 
calling exit with the string (the help for sys.exit shows that if a 
string is passed in, it will be printed before the process exits with 
failure -- something I wasn't aware of actually).

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   God heals, and the doctor takes the fee.
   -- Benjamin Franklin



More information about the Python-list mailing list