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

Mike Maxwell maxwell at ldc.upenn.edu
Mon Feb 23 15:12:59 EST 2004


<vent> I see there has been traffic over the years on this gripe, so just
let me vent my frustration, and add another reason why 'exit' (or possibly
exit() or quit() or halt() or some such) should exit Python, rather than
giving the ridiculous msg

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

The additional reason is that God intended Ctrl-D to be "scroll down", as in
vi.  I have my keyboard translator set up to do something very much like
that (actually, I translate ^D into a sequence of "cursor downs"), and
hitting the Ctrl-D key therefore does not drop me out of Python.  More
generally, it is probably not uncommon for someone to translate ^D into
something else, using xmodmap or some such.  I need to kill the entire
X-terminal to stop Python.

Now, if you're using a gui Python, there's probably a menu command you can
use to drop out.  But if you're using the command-line version (e.g. the one
in CygWin) from a shell prompt, then you're out of luck.

Why isn't there a command or function to drop out of Python??!!  Obviously
Python is clever enough to know that you want to exit when you type 'exit';
why does it make you stand on your head to do so?

Aaargh!

</vent>

    Mike Maxwell







More information about the Python-list mailing list