Issue9362
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010-07-23 19:24 by belopolsky, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Messages (26) | |||
|---|---|---|---|
| msg111374 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2010-07-23 19:24 | |
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.
|
|||
| msg111427 - (view) | Author: Ron Adam (ron_adam) * | Date: 2010-07-24 05:45 | |
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.
|
|||
| msg111455 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010-07-24 11:26 | |
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 |
|||
| msg111483 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2010-07-24 14:32 | |
> 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. |
|||
| msg111484 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2010-07-24 14:37 | |
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. |
|||
| msg111487 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2010-07-24 14:49 | |
> 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. |
|||
| msg111618 - (view) | Author: anatoly techtonik (techtonik) | Date: 2010-07-26 13:48 | |
On Fri, Jul 23, 2010 at 10:24 PM, Alexander Belopolsky <report@bugs.python.org> wrote: > 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 Type exit() or press Ctrl-D to exit. |
|||
| msg111619 - (view) | Author: Michael Foord (michael.foord) * ![]() |
Date: 2010-07-26 13:53 | |
+1 to improving the message and improving the help message too. |
|||
| msg111625 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2010-07-26 14:32 | |
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. |
|||
| msg111627 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010-07-26 14:50 | |
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! :) |
|||
| msg111636 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2010-07-26 15:32 | |
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. :-) |
|||
| msg111638 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010-07-26 15:45 | |
Could we (easily) add a third line at startup that says how to quit? |
|||
| msg111639 - (view) | Author: Alexander Belopolsky (belopolsky) * | ||
