Terminating Python...

Michael P. Reilly arcege at shore.net
Thu Jul 15 17:28:20 EDT 1999


Sebastien Tanguy <sebastien.tanguy at wanadoo.fr> wrote:
:>>>>> "AF" == Alex Flinsch <aflinsch at njeb.att.com> writes:

: AF> Fredrik Lundh wrote:

:>> in which way is typing "raise SystemExit<Return>" better
:>> than typing "<Control-D>" (which is documented in the
:>> Python Tutorial) ?
:>> 

: AF> "raise SystemExit" could be embedded in some python code, while a
: AF> <Control-D> could not be.  "raise SystemExit" would work on any
: AF> OS, no need to check if we are running windows or something else.

: and what about :

: import sys
: sys.exit(0)

: Doesn't it work on every platform ?

FYI: "sys.exit(N)" is just "raise SystemExit, N".

  -Arcege





More information about the Python-list mailing list