[Idle-dev] The '>>> ' prompt is bad
Terry Reedy
tjreedy at udel.edu
Thu Jun 21 23:10:55 CEST 2012
On 6/21/2012 1:08 PM, Roger Serwy wrote:
> Does allowing the cursor to leave the prompt considered a benefit or a
> detriment for teaching beginners? The last system I remember using that
> allowed for the cursor to leave the prompt was a line-number BASIC from
> the 1980's. I haven't used any interactive systems since then that
> allowed the cursor to leave the prompt.
Moving the cursor (with keys or mouse) is one way to rerun a previous
line. It is also the way to select previous input or output. Windows
Command Prompt (CP) gets around freezing the cursor to one line by
having a *separate* mouse-only select cursor (box when click, versus
underline for entry). That means that one can only correct mistakes *on
the same line* with backspace (destructive) or home/left arrow. As near
as I can tell, it is impossible to edit a previous line of a multiline
statement. Ugh. There is a reason I use Idle as my shell.
Also note that click on previous *statement* and hit enter copies the
entire statement (rather than just one line of a multiline statement)
and does not clear the current entry line. (So to rerun a previous
multiline statement, one must redo it line by line.)
So if I do
>>> <some non-trivial expression>
and I decide I want to use the expression as part of another statement
(say, assignment) I can do
>>> a =
and click enter the expression and I have the assignment statement I
want. In CP, one must copy first, jump back with HOME, and then add 'a
='. In Idle, one can also build a statement from more than one previous
statement.
>>> expr1
xxx
>>> expr2
yyy
>>> if <copy expr1> and <copy expr2>: ...
This is impossible in CP due to erase-before-copy.
In other words, do not cripple Idle the way Windows Prompt is!
--
Terry Jan Reedy
More information about the IDLE-dev
mailing list