The "loop and a half"

Steve D'Aprano steve+python at pearwood.info
Fri Oct 6 19:43:00 EDT 2017


On Sat, 7 Oct 2017 12:24 am, bartc wrote:

> print ("Enter blank expression to quit.")


I *despise* programs that do that, and would cheerfully and unapologetically
take their designers, disguise them as a lettuce, and stake them out to be
nibbled to death by snails.

At the interactive prompt, I am frequently hitting Enter on a blank line,
either by accident, or deliberately to break up the calculations into groups,
or just to give myself time to think.

Blank lines should be treated as "do nothing" and simply ignored, and there
should be an explicit QUIT command.

Actually two: your OS's version of EOF (Ctrl-D on Unix-like systems, Ctrl-Z
ENTER on Windows), plus at least one of the usual exit/quit/bye named
commands. (Localised into whatever natural language you are using for the
prompts.)



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list