Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Readline Functionality Without Recompiling Python

I recently upgraded to Ubuntu 10.04 LTS and refreshed my Python environment. I installed Python 2.7 from source. Unfortunately, I didn't notice that Setup.dist has the readline line commented out by default - by default, there is no readline support installed. I'm now using the Python interpreter as a REPL enough that the constant ^[[A and ^[[D are very obnoxious.

Can I add readline support quickly, or do I have to actually recompile Python again? It seems like the sort of thing where there should be a quick, sane way to do it, but I don't know such a way.

like image 404
Brighid McDonnell Avatar asked Sep 21 '10 21:09

Brighid McDonnell


1 Answers

There's a standalone gnureadline package available, you can install it using setuptools

$ easy_install readline

You might also consider using ipython instead.

like image 128
Adam Byrtek Avatar answered Nov 12 '22 10:11

Adam Byrtek