[Tutor] Python with readline

dman dman@dman.ddts.net
Wed, 17 Apr 2002 10:20:33 -0500


On Tue, Apr 16, 2002 at 08:42:01PM -0400, Erik Price wrote:
| A few weeks back I asked about how I could get some of the emacs-style 
| functionality (command history, emacs navigation keybindings) into my 
| Python 2.2 interactive interpreter.  Someone (I forget) said that this 
| is GNU Readline, and that I should look into recompiling with readline.
| 
| Well, I've tried a few different iterations of it -- by slightly 
| changing the Modules/Setup file in the source tree from my Python 2.2 
| tarball.  Unfortunately, I can't seem to get the right combination of 
| flags.  Here is the text of the section where I'm supposed to turn it on:
| 
| <snip>
| # GNU readline.  Unlike previous Python incarnations, GNU readline is
| # now incorporated in an optional module, configured in the Setup file
| # instead of by a configure script switch.  You may have to insert a
| # -L option pointing to the directory where libreadline.* lives,
| # and you may have to change -ltermcap to -ltermlib or perhaps remove
| # it, depending on your system -- see the GNU readline instructions.
| # It's okay for this to be a shared library, too.
| 
| #readline readline.c -lreadline -ltermcap
| </snip>
| 
| I've tried simply uncommenting the line, adding the -L option in various 
| places on the line, specifying a path to my readline library, etc, but I 
| haven't had success -- either the ./configure has failed, the make has 
| failed, or I've ended up with a Python with no readline ability -- 
| exactly what I have now.
| 
| Does anyone have any familiarity with setting Python up for this?  I'm 
| using Mac OS X 10.1.3, but I can't imagine that the procedure is much 
| different than for Linux or any other Unix.  I'm not really clear on 
| what readline does, I imagine it's some kind of library, but my lack of 
| familiarity with C and the whole "make" business is probably making this 
| difficult for me to grasp.

Yeah, understanding the C compilation environment really does help in
these situations.

Where are your readline and termcap libraries installed?  What is the
error message the build process gives you?

Do you have sshd running on your system?  (if so you can give someone
else shell access and they can work with the system to get it built)

-D

-- 

Python is executable pseudocode. Perl is executable line noise.