Exiting python to the DOS shell in 2.3

Discussion in 'Python' started by Stephen Boulet, Aug 18, 2003.

  1. 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
     
    Stephen Boulet, Aug 18, 2003
    #1
    1. Advertising

  2. Stephen Boulet

    Alan Kennedy Guest

    [Stephen Boulet]
    > 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?


    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.
    >>> ^Z

    C:\>

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


    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
     
    Alan Kennedy, Aug 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Fairbank
    Replies:
    2
    Views:
    5,460
  2. john san
    Replies:
    19
    Views:
    743
    Diez B. Roggisch
    Feb 18, 2005
  3. tomhr
    Replies:
    27
    Views:
    1,421
    Mike Wahler
    Jan 12, 2006
  4. Tobiah

    Exiting from python shell

    Tobiah, Jul 18, 2007, in forum: Python
    Replies:
    2
    Views:
    329
    Mark Elston
    Jul 19, 2007
  5. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    281
    Michele Dondi
    Jan 22, 2004
Loading...

Share This Page