Exiting python to the DOS shell in 2.3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephen Boulet

    Exiting python to the DOS shell in 2.3

    Control-C doesn't get me back to the DOS prompt anymore in python 2.3.
    Aside from typing "import sys" and "sys.exit() ", is there a key
    combination to quit python?

    BTW, the "enumerate" function is the best thing since sliced bread.

    -- Stephen

  • Alan Kennedy

    #2
    Re: Exiting python to the DOS shell in 2.3

    [Stephen Boulet][color=blue]
    > Control-C doesn't get me back to the DOS prompt anymore in python 2.3.
    > Aside from typing "import sys" and "sys.exit() ", is there a key
    > combination to quit python?[/color]

    The EOF character should do the job on any platform. On Windows/DOS,
    the EOF character is ctrl-Z, on *nix it's ctrl-D. Here is a transcript
    of a (brief) python session on win2K:

    C:\>python
    Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)]
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> ^Z[/color][/color][/color]
    C:\>
    [color=blue]
    > BTW, the "enumerate" function is the best thing since sliced bread.[/color]

    IMHO, generators, i.e. resumable functions, are the best thing since
    sliced bread ;-) but enumerate is pretty useful too.

    regards,

    --
    alan kennedy
    -----------------------------------------------------
    check http headers here: http://xhaus.com/headers
    email alan: http://xhaus.com/mailto/alan

    Comment

    Working...