home > developer > pythonReadlineSetup.html

Tuesday, October 25th, 2005

Python + Readline = Auto Complete

I can’t really tolerate a command line and/or programming environment that doesn’t include a usable auto-completion feature (like Python’s built-in shell). To solve this problem, I’m using the “enhanced” shell IPython on my Windows machine. It wasn’t working well, but then I found that IPython’s docs suggest that I need the readline extention:

While you can use IPython under Windows with only a stock Python installation, there is one extension, readline, which will make the whole experience a lot more pleasant. It is almost a requirement, since IPython will complain in its absence (though it will function). The readline extension needs two other libraries to work, so in all you need:

  1. PyWin32 from http://starship.python.net/crew/mhammond.
  2. CTypes from http://starship.python.net/crew/theller/ctypes (you must use version 0.9.1 or newer).
  3. Readline for Windows from http://sourceforge.net/projects/uncpythontools.

Sweet. Download 3 exe’s. Install. It works and I’m happy. Lesson: sometimes it’s useful to read documentation.

See IPython’s quick tips for a crash course in the magic of IPython.

Also, see ONLamp’s tutorial.

/developer   〆   permalink