Due to the political manifesto that is the GPL, Python on Mac OS X does not ship with the readline module.
This is hugely annoying. Interactive command line python is pretty close to useless without basic history and editing commands.
It is easy enough to fix. Would be easier if I didn’t also want to use the latest libreadline; version 5.1.
Either mount this in the Finder or:
svn co http://svn.red-bean.com/bbum/trunk/pyreadline/
From there, follow the instructions in the README. It definitely works with the stock Python on Mac OS X Intel. Should work for PPC, too.
It will likely also work for Python 2.4, but I haven’t tested it. If not, copying the readline.c from Python 2.4 into the readline-0.0.0 directory.
As Paul said, check out iPython. It offers an incredible interactive mode with full blown object introspection, including integrated documentation. I use it when I remember (thanks fro the reminder), but I also avoid it when doing examples for others or generating doctest test cases.
- added iPython info
- fixed stupid typo