ActiveBlog

Better interactive shell for ActivePython
by Sridhar Ratnakumar

Sridhar Ratnakumar, February 17, 2010

ActivePython users on Linux or MacOSX may have noted that the arrow keys do not work properly in the command-line Python shell. When you hit up-arrow in the shell, ActivePython gives you "^[[A". This is because ActivePython does not include GNU readline due to licensing restrictions.

ipython-on-mac

Fortunately, ActivePython comes with PyPM (Python Package Manager), using which you can install readline yourself. While you're doing that, you might also want to try IPython, which provides tab completion and a number of other nifty features.

If you are using Linux or MacOSX, then all you need to do is type the following in Terminal:


$ pypm install readline
$ pypm install ipython

On Windows, in the command prompt window:


C:\> pypm install pyreadline
C:\> pypm install ipython

You'll need ActivePython 2.6.4.10 or above installed (3.x is not supported by PyPM yet). To learn about IPython, see Jeff Rush's video demonstrations.

Subscribe to ActiveState Blogs by Email

Share this post:

Category: ActiveBlog, python
About the Author: RSS

Sridhar Ratnakumar is a senior Python developer at ActiveState where he works tirelessly to ensure that ActivePython is the world's highest quality Python distribution. He's been developing on Python since 2003 and is the author of various Python modules, including pyrtm and applib. He earned his software development stripes at Amazon and Microsoft.