Terminating Python...

Fredrik Lundh fredrik at pythonware.com
Wed Jul 14 14:55:55 EDT 1999


Velasquez, Carlos <carlos.velasquez at ssmb.com> wrote:
> I just downloaded and built Python v1.51 for the Sun Solaris platform. All
> the tests went well and I created some simple scripts to verify its
> operation. One question is, how do I exit python? The only thing that works
> is <Ctrl> Z but that just stops the job. if I execute Python again and Ctrl
> Z again, and if I do a ps -ef to see all processes, there are 2 python
> instances.
> 
> Is there a correct way to exit from Python?

the tutorial has the answer:
http://www.python.org/doc/current/tut/node4.html

    Typing an EOF character (Control-D on Unix, Control-Z on
    DOS or Windows) at the primary prompt causes the inter-
    preter to exit with a zero exit status.

which is a slightly convoluted way to say:

    "to get out, press Control-D if you're on a Unix box.  On
    Windows and MS-DOS, use Control-Z followed by Return
    instead.

</F>





More information about the Python-list mailing list