Gripe: Use Ctrl-D (i.e. EOF) to exit

François Pinard pinard at iro.umontreal.ca
Mon Feb 23 19:26:35 EST 2004


[Mark Jackson]
> "Mike Maxwell" <maxwell at ldc.upenn.edu> writes:

> > Why isn't there a command or function to drop out of Python??!!

> from sys import exit
> exit()

Or maybe, a bit simpler:

   raise SystemExit

One may also manage to merely fall to the end of your __main__ module.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list