Enable readline support in Panther's Python

Jan 12, '05 07:00:00AM

Contributed by: guybrush

Python's interactive interpreter supports readline style command line editing. That is, a good chunk of the basic emacs text editing/navigation commands will work at the interpreter prompt -- but only if the readline module is available. Because it is tainted by the GPL, Mac OS X does not ship with the readline library.

To enable readline support, just enter the following command in the Terminal:

python `python -c "import pimp; print pimp.__file__"` -i readline
I found this hint on Bill Bumgarner's blog, and saw it wasn't mentioned on macosxhints. So credits go to him for the whole problem discription, and to Bob Ippolito for the elegant solution.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050107140338573