[Pythonmac-SIG] readline

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


On 11/30/02 11:04 PM, I wrote:

>> http://radio.weblogs.com/0100490/2002/10/16.html
>> http://radio.weblogs.com/0100490/2002/09/25.html
>> 
>> I haven't tested them but knowing Bill, they should work. ;-)
> 
> It does. Thank you. I just installed it. It uses readline from Python
> 2.2.1 and installs it into the built-in Python 2.2 in OS 10.2 in an
> instant. Now I can develop my Python segments in a more human manner
> before converting them (or running them as .py files) in 'do shell script'
> in AppleScript and AS Studio. This is great.
> 
> Now - where do I find out what to do with it? I see that my left and right
> arrows work immediately in the Python interpreter but not the up-arrow.
> (Nor does control-P, which I thought I read somewhere put the cursor up a
> line.)    
> 

OK. I've seen in Appendix A to the Python Tutorial
(<http://www.python.org/doc/2.2.2/tut/node13.html>)
how to use control-P to access an input line higher up in the buffer. It
retypes it on the current line. But I don't understand how to edit the line
as described: after altering the line, if I press Return I get a syntax
error (the line was in the middle of a function def); if I press control-N
repeatedly until I get back to the bottom of the buffer, nothing gets
edited. Is there somewhere that describes the procedure to use and its
limitations, which perhaps I'm exceeding here?



-- 
Paul Berkowitz