On 06/21/2012 04:10 PM, Terry Reedy wrote:
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.
I'm not suggesting an implementation of Window's CP behavior, as I find
it too limited as well. On Linux, up/down arrows at the command prompt
cycle through the command history. Many other interactive programs
behave the same way, like Octave, Matlab, R, Python, etc. For some
reason, IDLE has this very different behavior for its prompt. I opened
this report a long time ago, which has some discussion along these
lines: http://bugs.python.org/issue2704
IdleX has the Terminal.py extension included which makes IDLE behave how
I think it should behave.
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.)
Alt+P and Alt-N are not discoverable in IDLE, except as a keybinding in
the configuration dialog. The "shell" menu should have these commands.
Cycling through the history recovers multi-line commands.
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!
_______________________________________________
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev