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

10.4: Add readline support to Tiger's python UNIX
For licensing reasons, Python on OS X comes without readline support (libreadline is GPL). Unfortunatley, this earlier hint no longer works in Tiger.

There is, however, a standalone readline distutils package made by Bill Bumgarner. I have slightly adapted it [click to download] to work either with a pre-installed readline from Fink, or with the included readline-5.1 without installing it. Hope this helps!

[robg adds: I haven't tested this one.]
    •    
  • Currently 4.20 / 5
  You rated: 5 / 5 (5 votes cast)
 
[14,158 views]  

10.4: Add readline support to Tiger's python | 4 comments | Create New Account
Click here to return to the '10.4: Add readline support to Tiger's python' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Add readline support to Tiger's python
Authored by: juanfal on Jan 12, '07 10:33:24AM
You always can use rlwrap:
rlwrap 
Usage: rlwrap [options] command ...

Options:
   -a, --always-readline[=password:] 
   -b, --break-chars 
   -c, --complete-filenames
   -C, --command-name 
   -f, --file 
   -h, --help
   -l, --logfile 
   -n, --no-warnings
   -r, --remember
   -v, --version
   -s, --histsize 

bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/
with any line interpreter.
% port info rlwrap
rlwrap 0.24, sysutils/rlwrap
http://utopia.knoware.nl/~hlub/uck/rlwrap/

rlwrap is a 'readline wrapper' that uses the GNU readline library to allow the editing of keyboard input for any other command.

Library Dependencies: readline
Platforms: darwin
Maintainers: lomion@mac.com
: I have defined:
alias irb 'rlwrap irb'
and many similar others, so I can easily edit Ruby code, for example:
% irb
irb(main):001:0> 5.times { p "Hola" }
"Hola"
"Hola"
"Hola"
"Hola"
"Hola"
=> 5
irb(main):002:0> 


[ Reply to This | # ]
10.4: Add readline support to Tiger's python
Authored by: vocaro on Jan 12, '07 10:55:47AM
Why not just install Python using Fink? It solves the same problem, but it's much easier than compiling readline from source, and you get easy uninstallation, too.

[ Reply to This | # ]
Hint does not say to compile anything!
Authored by: GaelicWizard on Jan 13, '07 07:56:52PM

If you read the Hint (and the web site) you'll see that you don't have to compile anything! You just have to install the Dev Tools (which *have* readline), and then tell python to use it (by running a tiny script).

JP

---
Pell



[ Reply to This | # ]
10.4: Add readline support to Tiger's python
Authored by: Christoph on Jan 15, '07 08:24:24AM

This depends on your definition of "easier". I find it easier to add a feature to a working install rather than installing the entire large package from scratch from a different source. Python is provided as a Fink package mainly for internal Fink dependencies so that Fink is independant from MacPython.

There are however two reasons (for me) to prefer MacPython (shipped with OSX) to the Fink python (the same applies to Tcl/Tk):

1) As a developer I have the same environment as an end user on a bare bones OSX so that I can be sure that my software will run also on a daisy OSX box.

2) The GUI libraries are Carbon versions rather than X11 versions as in Fink.



[ Reply to This | # ]