Readline functionality on windows with python 2.7

Issue

I need to import the readline functionality in a program written in python. I am currently using version 2.7 and the 3rd party packages I have seen only work up to version 2.6. Does anyone know of a 3rd party readline package for Windows with Python 2.7?

Solution

I believe pyreadline was designed just for this.

easy_install pyreadline
or:
pip install pyreadline

http://pypi.python.org/pypi/pyreadline

Also, use the following for forward/reverse compatibility:

try:
  import readline
except ImportError:
  import pyreadline as readline

Answered By – Ben Burns

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published