[Pythonmac-SIG] readline

Paul Berkowitz berkowit@silcom.com
Sun, 01 Dec 2002 13:33:05 -0800


On 12/1/02 1:25 PM, "Skip Montanaro" <skip@pobox.com> wrote:

> 
>     Paul> But I don't understand how to edit the line as described: after
>     Paul> altering the line, if I press Return I get a syntax error (the
>     Paul> line was in the middle of a function def);
> 
> The readline interface is pretty dumb.  In particular, you can't edit
> compound statements as a group.  You have to reenter the lines prior to the
> line you want to edit (generally using Ctl-P or Ctl-R to search for them),
> then correct the line with the mistake.
> 
> If you find this cumbersome (and you should if you need to reenter more than
> a line or two), just break down and edit your code in a file, say,
> mymod.py.  Once you make the desired corrections and save the file, you can
> reload it by executing
> 
>     reload(mymod)
> 
> at the interpreter prompt.

(After first having imported it in the first place, yes.) I'll probably end
up mostly doing that once I get the hang of more basic scripting. The docs
refer to the edited line being displayed with an asterisk - I haven't seen
that yet, even editing a single line. When does that happen?

-- 
Paul Berkowitz