Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.

arrow keys in interpreter ^[[D

kgore4
Beginner
2,402 Views

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
1 Solution
Robert_C_Intel
Employee
2,402 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
Robert_C_Intel
Employee
2,403 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

0 Kudos
gaston-hillar
Valued Contributor I
2,402 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
sergio_r_
Novice
2,402 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-video
2) https://www.packtpub.com/big-data-and-business-intelligence/learning-scipy-numerical-and-scientific-computing-second-edition
3) FREE (beginner) PYTHON book in Spanish:
   https://www.researchgate.net/publication/301293668_Aprendiendo_a_Programar_en_Python_con_mi_Computador_Primeros_pasos_rumbo_a_computos_de_gran_escala_en_las_Ciencias_e_Ingenierias

 

0 Kudos
Osanda_G_
Beginner
2,402 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-computing-second-edition
3) FREE (beginner) PYTHON book in Spanish:
   https://www.researchgate.net/publication/301293668_Aprendiendo_a_Programar_en_Python_con_mi_Computador_Primeros_pasos_rumbo_a_computos_de_gran_escala_en_las_Ciencias_e_Ingenierias

 

0 Kudos
YOUNGJAE_C_
Beginner
2,402 Views

Try

pip install gnureadline

instead just readline

0 Kudos
Todd_T_Intel
Employee
2,402 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
Reply