arrow keys in interpreter ^[[D

arrow keys in interpreter ^[[D

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.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

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

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

 

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

 

Worked for me, simpler than messing with conda

 

Quote:

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

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today