Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86225

Re: Python shell: Arrow keys not working in PuTTY

Date 2015-02-23 08:33 -0600
From Tim Chase <python.list@tim.thechases.com>
Subject Re: Python shell: Arrow keys not working in PuTTY
References <41302A7145AC054FA7A96CFD03835A0A0B9451B8@EX10MBX02.EU.NEC.COM>
Newsgroups comp.lang.python
Message-ID <mailman.19073.1424702467.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 2015-02-23 13:44, David Aldrich wrote:
> I want to use the Python 3.4 interpreter interactively, via a PuTTY
> ssh session.  Python is running on Centos 5.
> 
> Currently, the arrow keys do not work:
[snip]
> sudo apt-get install libreadline-dev
> 
> followed by a rebuild of Python
> 
> or
> 
> pip install readline
> 
> Please can anyone comment on the easiest way to fix this?  Is a
> rebuild of Python necessary?

Depends on what you consider "easier".  If you install readline, but
don't want to rebuild Python, you could also try installing the
rlwrap program and then invoking Python with that:

  bash$ rlwrap python

which should intercept the inputs and handle them with some nice
readline capabilities.

Otherwise, just make sure that Python builds with readline support as
you've read elsewhere.

-tkc

PS: and you mention being on CentOS but running apt-get.  I believe
CentOS and other Red-Hat based distros use "yum" instead of "apt-get"



Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python shell: Arrow keys not working in PuTTY Tim Chase <python.list@tim.thechases.com> - 2015-02-23 08:33 -0600

csiph-web