python2.7 starts the Python interpreter requires the Shift+del key to delete, does not support the BACKSPACE key, does not support tab completion. It is very inconvenient to use it anyway. Solving this problem can be solved by specifying a python startup script.
First step: Add Pythonstartup Environment variables
echo "Export pythonstartup= $HOME/.pythonstartup" >>/etc/profile
Step two: Create a. Pythonstartup script
Cat >> $HOME/.pythonstartup <<eofimport rlcompleterimport readlinereadline.parse_and_bind ("Tab:complete ") EOF
Step three: Make the environment variable effective
Source/etc/profile
Fourth Step: Test
Start the Python interpreter
Python
If the prompt does not have a ReadLine module, install it
Pip Install ReadLine
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/A6/wKioL1YDb3-zXf7vAAP1UQSVxQY645.jpg "title=" Qq20150924113459.png "alt=" Wkiol1ydb3-zxf7vaap1uqsvxqy645.jpg "/>
After testing, TAB and BACKSPACE are working properly.
This article is from the "Candle Shadow Red" blog, be sure to keep this source http://gccmx.blog.51cto.com/479381/1697761
Custom Python startup script enables the interactive interpreter to support tab and delete keys