Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Enable readline support in Panther's Python UNIX
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.
    •    
  • Currently 2.83 / 5
  You rated: 1 / 5 (6 votes cast)
 
[16,537 views]  

Enable readline support in Panther's Python | 3 comments | Create New Account
Click here to return to the 'Enable readline support in Panther's Python' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Enable readline support in Panther's Python
Authored by: johnblommers on Jan 12, '05 05:25:39PM

Of course you meant to preface the command with sudo since you'd not normally be logged in a root ...



[ Reply to This | # ]
Enable readline support in Panther's Python
Authored by: boredzo on Jan 12, '07 08:22:37PM

gnutar et al are not libraries. readline is a library, which means it gets combined with other programs, which creates GPL infections.

Mac OS X does come with the BSD libedit, which includes a readline compatibility API, but it does not provide vi mode as complete as readline's.



[ Reply to This | # ]
Enable readline support in Panther's Python
Authored by: gospodin_david on Jan 13, '05 12:06:09PM
Just an aside: I'm pretty sure that the reason OS X ships without readline isn't because of the GPL. After all, it does ship with gnutar (which most certainly is under the GPL) and other software. Take a look at this to see a bunch of parts of Darwin which aren't under the APSL. Most of the "Other"s are GPL or BSD.

[ Reply to This | # ]