[Pythonmac-SIG] readline

Skip Montanaro skip@pobox.com
Sun, 1 Dec 2002 15:25:14 -0600


    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.

-- 
Skip Montanaro - skip@pobox.com
http://www.mojam.com/
http://www.musi-cal.com/