[issue9362] Make exit/quit hint more novice friendly
New submission from Alexander Belopolsky <belopolsky@users.sourceforge.net>: This bikeshed have been repainted several times already, but here is a true story. Cast: Me = myself Novice = a 14-year-old boy Laptop = a MacBook Air Novice: How do i exit [from python prompt]? Me: What's your best guess? Novice: [typing] exit [pressing Enter] Laptop: Use exit() or Ctrl-D (i.e. EOF) to exit Novice: [typing] Ctrl... Me: OMG, you don't know what Ctrl-D means? Look for the Ctrl key. Novice: There is no such key. --- curtains --- I suggest changing Use exit() or Ctrl-D (i.e. EOF) to exit to Type exit() or quit() and press the Enter key to exit or Type exit() or quit() and press Enter to exit or just Use exit() to exit My theory is that someone who knows what EOF is, will probably already know how to exit from common terminal oriented programs and Ctrl-D is not universally bound to EOF. TOOWTDI: two ways to exit is more than enough to teach a novice. ---------- assignee: docs@python components: Documentation keywords: easy messages: 111374 nosy: belopolsky, docs@python priority: normal severity: normal status: open title: Make exit/quit hint more novice friendly type: feature request versions: Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Ron Adam <ron_adam@users.sourceforge.net> added the comment: I agree it could be improved a bit. A little experimenting comes up with the following inconsistencies.
quit Use quit() or Ctrl-D (i.e. EOF) to exit exit Use exit() or Ctrl-D (i.e. EOF) to exit
help(exit) and help(quit) is not helpful. It instead shows the Quitter class in site.py with no doc strings. exit() and quit() are both equivalent to sys.exit() and both except an exit code or message. I think your third choice is good. Type exit() or quit() and press Enter to exit Advance users can still use Cntl-D. Add a topics entry for help('EXIT') which can explain exiting the console in more detail and include the Ctrl-D short cut. help('QUIT') can point to the same topics info used for 'EXIT'. Then add a doc string the the Quitter class that says to use help('EXIT') or help('QUIT') to get help for exit and quit. On another note: I've sometimes wanted quit() to exit from a running script to the python console so I can do a little value checking. And for exit() to exit both the program and the console. But I think it may be too lake to make that particular change. ---------- nosy: +ron_adam _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Mark Lawrence <breamoreboy@yahoo.co.uk> added the comment: I assume that this is on *nix boxes, on Windows it's:-
quit Use quit() or Ctrl-Z plus Return to exit exit Use exit() or Ctrl-Z plus Return to exit
---------- nosy: +BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment:
I assume that this is on *nix boxes
It's a bit of a stretch to call OSX unix, but yes:
Laptop = a MacBook Air
If you have not seen one of these, the control key is marked "control" on its keyboard. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment: Now, as I look at it, the windows message is probably even worse. What is "plus"? Is "Ctrl-Z" control *minus* z? For a novice, you really have to say: press Ctrl and Z keys together and then press Return or Enter key. Of course this longer phrase is not appropriate for the exit hint. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment:
On another note: I've sometimes wanted quit() to exit from a running script to the python console so I can do a little value checking.
This is what -i command line switch or PYTHONINSPECT environment variable is for. See python -h output. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment: On Mon, Jul 26, 2010 at 9:48 AM, anatoly techtonik <report@bugs.python.org> wrote: ..
Type exit() or press Ctrl-D to exit.
Anatoly, I think you missed the point of the story that I posted. The young user, who was not completely new to computers, by the way, was not familiar with "Ctrl" abbreviation and there was no key marked that way on his keyboard. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment: On Mon, Jul 26, 2010 at 5:32 PM, Alexander Belopolsky <report@bugs.python.org> wrote:
I think you missed the point of the story that I posted. The young user, who was not completely new to computers, by the way, was not familiar with "Ctrl" abbreviation and there was no key marked that way on his keyboard.
The stuff that should be explained once in a lifetime to every newborn software engineer will waste million of braincycles over the world every time the stuff is read. You need to consider changing the school program in your region to add practical computer lessons where chindren are explained all questions they have about computers. -- anatoly t. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Michael Foord <michael@voidspace.org.uk> added the comment: +1 to improving the message and improving the help message too. ---------- nosy: +michael.foord _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Mark Lawrence <breamoreboy@yahoo.co.uk> added the comment: 1) I'm with Michael on this one. 2) Python is not responsible for dotting every i and crossing every t for a computer novice. What would the novice make of my HP keyboard which doesn't have keys marked RETURN or BS, they both have symbols. There isn't an ANY key on the keyboard either! :) ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment: On Mon, Jul 26, 2010 at 10:50 AM, Mark Lawrence <report@bugs.python.org> wrote: ..
2) Python is not responsible for dotting every i and crossing every t for a computer novice.
Yes, but it is not responsible for teaching a novice more than one way to exit the interpreter right off the bat. Note that the Ctrl-D/Ctrl-Z recommendation has a long history from the time when there was no exit/quit object defined in the default site.py and the alternative to the magic key-press was an unwieldy raise SystemExit. Note the following bug report from IDLEfork project: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=693333&group_id=9579 Apparently, some IDEs may want to rebind Ctrl-Z form EOF to (in this case) undo action. This is quite reasonable, but it makes the exit hint misleading. There are many reasons outside of python control for EOF to be bound to the keys other than Ctrl-Z/D. The current logic in site.py that makes a choice based on the filepath separator character is quite fragile: if os.sep == ':': eof = 'Cmd-Q' elif os.sep == '\\': eof = 'Ctrl-Z plus Return' else: eof = 'Ctrl-D (i.e. EOF)'
What would the novice make of my HP keyboard which doesn't have keys marked RETURN or BS, they both have symbols.
There is very little you can do at the command prompt without knowing where your enter key is. In fact, you will not even see the hint in question if you don't press enter after typing exit. On the other hand, you can get quite far without using control key and if it is marked "control" or a national equivalent on your keyboard, you may not know the ctrl abbreviation for quite some time. Note that my last alternative, "Use exit() to exit" or "Enter exit() to exit" does not require knowing how the enter key is called. The user just need to know the means of entering commands and he or she must know this before seeing the exit hint anyways.
There isn't an ANY key on the keyboard either! :)
Right. And computer industry would save loads of money in support calls if they instructed users to press the space bar instead. :-) ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Mark Lawrence <breamoreboy@yahoo.co.uk> added the comment: Could we (easily) add a third line at startup that says how to quit? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment: On Mon, Jul 26, 2010 at 11:45 AM, Mark Lawrence <report@bugs.python.org> wrote:
Mark Lawrence <breamoreboy@yahoo.co.uk> added the comment:
Could we (easily) add a third line at startup that says how to quit?
+1 Alternatively, we can add the second line to help output: Type help() for interactive help, or help(object) for help about object. Type exit() to exit python. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment: On Mon, Jul 26, 2010 at 7:03 PM, Alexander Belopolsky <report@bugs.python.org> wrote:
Could we (easily) add a third line at startup that says how to quit?
+1
+1 - Type "help", "copyright", "credits" or "license" for more information. + Type "help", "copyright", "credits" or "license" for more information, "exit" to quit.
Alternatively, we can add the second line to help output:
Type help() for interactive help, or help(object) for help about object. Type exit() to exit python.
-0.5 (no beer from me) BTW, Ctrl-D works on Windows also. No need to maintain system-specific Ctrl-Z shortcut. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Brian Curtin <curtin@acm.org> added the comment: Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
^D File "<stdin>", line 1 ♦ ^ SyntaxError: invalid syntax
---------- nosy: +brian.curtin _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment: Something is broken in your 3.1.2 - this is Ctrl-D for me. {{{ Microsoft Windows [Version 6.0.6002] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\~env\Python26>python Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
C:\~env\Python26> }}} ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Brian Curtin <curtin@acm.org> added the comment: Do you have pyreadline installed? If so, that is causing it. If not, it's something else as Ctrl-D is not an EOF character on Windows. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment: It appears that `import pyreadline` goes ok. It appears that this lib is used for unification of console incompatibilities between platform. Why not to ship it in Python by default? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Alexander Belopolsky <alexander.belopolsky@gmail.com> added the comment: On Jul 26, 2010, at 4:32 PM, anatoly techtonik <report@bugs.python.org> wrote:
Why not to ship it in Python by default?
Because it is under GPL? ---------- nosy: +Alexander.Belopolsky _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment:
Why not to ship it in Python by default?
Because it is under GPL?
pyreadline is under BSD. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Changes by Brian Curtin <curtin@acm.org>: ---------- nosy: -brian.curtin _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Mark Lawrence <breamoreboy@yahoo.co.uk> added the comment: c:\py3k\Lib>py32 Python 3.2a0 (py3k:83057M, Jul 22 2010, 15:20:27) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
^D File "<stdin>", line 1 ♦ ^ SyntaxError: invalid syntax [49008 refs]
This to me is getting stupid. Let's make a decision and move on, there are far more pressing issues that need attention. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment: On Mon, Jul 26, 2010 at 11:48 PM, Mark Lawrence <report@bugs.python.org> wrote:
This to me is getting stupid. Let's make a decision and move on, there are far more pressing issues that need attention.
Do you think that getting `readline` module to run on Windows is stupid? I think it is stupid that IPython ships pyreadline to fill the gap on Windows - it should be done in Python distribution. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Tim Golden <mail@timgolden.me.uk> added the comment: Not necessarily; pyreadline takes over from the standard console functionality on Windows in order to emulate a more Unix-ish approach. I prefer the Windows default. There's nothing to stop someone downloading and installing pyreadline as a third-party package on Windows ---------- nosy: +tim.golden _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Westley Martínez <anikom15@gmail.com> added the comment: This is annoying. Every beginner's Python tutorial I've read made it very clear how to exactly exit the interactive shell. Ctrl has been in use for years. Changing it for novices' sake is ridiculous. Do we need to expand every abbreviation? Python will turn into Java (joke). As for Ctrl-D or Ctrl-Z, I think it's fine the way it is. Python is used for scripting, and Windows administators are familiar with Ctrl-Z for EOF but may not necessarily be familiar with Ctrl-D. Ok, in final, I think the only thing that might be changed is the shell's opening message: Python 3.1.3 (r313:86834, Jan 28 2011, 20:00:55) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. Type "exit()", "quit()" or Ctrl-D (i.e. EOF) to exit.
On Windows, Ctrl-D is replaced with Ctrl-Z. ---------- nosy: +anikom15 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Jeff Ramnani <jeff@jefframnani.com> added the comment: I've checked Lib/site.py and it tells the user to use 'Ctrl-Z' to exit the prompt when they are running Windows. Perhaps this means we can close the ticket, since discussion on this issue seems to have dissipated? ---------- nosy: +jramnani _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
Changes by Brian Curtin <brian@python.org>: ---------- resolution: -> rejected stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9362> _______________________________________
participants (10)
-
Alexander Belopolsky
-
anatoly techtonik
-
anatoly techtonik
-
Brian Curtin
-
Jeff Ramnani
-
Mark Lawrence
-
Michael Foord
-
Ron Adam
-
Tim Golden
-
Westley Martínez