Another stupid question...

Quinn Dunkan quinn at chunder.ugcs.caltech.edu
Wed May 29 02:08:44 EDT 2002


>> check that you have the header files for the 'readline'
>> library installed before you 'configure'. I guess
>> you also need to exec 'import rlcompleter' (readline-completer)
>> somewhere in your startup files (PYTHONSTARTUP points to a script).

That's not quite true.  If readline is available, it will be automatically
imported.

>but i don't understand what i had to do !!! or what i must check !!!
>i'm a newbie in python, and unix' world...

Type 'import readline' at the >>>.  If you get another >>>, readline is
installed.  If you get ImportError, you need to compile readline.so.  This
should be handled automatically by the python setup.py which gets run when you
type make.  The problem is that if it can't find the readline library, it won't
build readline.so.  There are two possibilities: you have readline but setup.py
didn't find it, or you don't have readline.  For the first, you can stick the
lib and include libraries at the top of the detect_modules() method of setup.py
(don't know if there's a better way, but you shouldn't have to know python
to install it...).  For the second, go to a gnu mirror and download readline.

If it can find readline, then I dunno.  ^[[A is a standard up-arrow code
(it's what my xterm sends), but terminals under unix are a giant mess.  You
could put 'set editing-mode vi' in ~/.inputrc and type ^[k :)

If you have a sun, or a linux like debian or redhat, chances are you can
install python using whatever package scheme and it should have readline.

If you have a more obscure system and are a unix newbie, then get your
sysadmin to do it.  If you don't have a sysadmin, then... um... time to start
learing the Unix Compile Game :)



More information about the Python-list mailing list