Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
158 Views

arrow keys in interpreter ^[[D

Jump to solution

In 2.7.10 the arrow keys work normally

In 2.7.11 left gives ^[[D

In 2.7.13 left gives ^[[D

Tried various terminal setups in putty and from a nomachine session and from an xterm.  Host is centos7. all 3 version are installed on the same machine.

Up arrow gives ^[[A which makes it annoying to retype a whole line for a simple typo.

0 Kudos

Accepted Solutions
Highlighted
Employee
158 Views

Arrow keys require the readline library, which is GPL. The simplest solution is to use python from anaconda + intel libraries for everything else:

 

conda remove --force python

conda install -c anaconda python

View solution in original post

0 Kudos
6 Replies
Highlighted
Employee
159 Views

Arrow keys require the readline library, which is GPL. The simplest solution is to use python from anaconda + intel libraries for everything else:

 

conda remove --force python

conda install -c anaconda python

View solution in original post

0 Kudos
Highlighted
Black Belt
158 Views

kgore4,

In case you move to IPython, make sure you read this post because readline is also GPL. Just in case...

https://software.intel.com/en-us/forums/intel-distribution-for-python/topic/704018

 

0 Kudos
Highlighted
Beginner
158 Views

A workaround to resolve the arrow key issue (tested under linux sh shell) is to start python preceded by 'rlwrap' like so:

$ rlwrap python

This can be written as an alias in the ".bashrc" file

Sergio

Enhance your #MachineLearning and #BigData skills via #Python #SciPy
1) https://www.packtpub.com/big-data-and-business-intelligence/numerical-and-scientific-computing-scipy...
2) https://www.packtpub.com/big-data-and-business-intelligence/learning-scipy-numerical-and-scientific-...
3) FREE (beginner) PYTHON book in Spanish:
   https://www.researchgate.net/publication/301293668_Aprendiendo_a_Programar_en_Python_con_mi_Computad...

 

0 Kudos
Highlighted
Beginner
158 Views

Worked for me, simpler than messing with conda

 

sergio r. wrote:

A workaround to resolve the arrow key issue (tested under linux sh shell) is to start python preceded by 'rlwrap' like so:

$ rlwrap python

This can be written as an alias in the ".bashrc" file

Sergio

Enhance your #MachineLearning and #BigData skills via #Python #SciPy
1) https://www.packtpub.com/big-data-and-business-intelligence/numerical-an...
2) https://www.packtpub.com/big-data-and-business-intelligence/learning-scipy-numerical-and-scientific-...
3) FREE (beginner) PYTHON book in Spanish:
   https://www.researchgate.net/publication/301293668_Aprendiendo_a_Programar_en_Python_con_mi_Computad...

 

0 Kudos
Highlighted
Beginner
158 Views

Try

pip install gnureadline

instead just readline

0 Kudos
Highlighted
Employee
158 Views

Update for this older thread:

Our Linux python 3 distribution now includes pyeditline, a python package that implements much of the readline functionality on top of the editline library. You should see normal command-line editing features in python 3 on linux. We don't plan on adding it to our python 2.7 distribution at this time because pyeditline does not support python 2.

You can install it into an existing python 3 environment using "conda install pyeditline -c intel".

Todd

 

0 Kudos