The following error occurred while using Yum
File "/usr/bin/yum", line 30
Except Keyboardinterrupt, E:
^
Syntaxerror:invalid syntax
This is caused by the upgrade of Python
Vim/usr/bin/yum
Change #!/usr/bin/python2 to #!/usr/bin/python2.6
--------------------------------------
Direction key garbled
Arrow keys appear ^[[a^[[b^[[d^[[c^h when using Python
The CentOS 6.5 default installs only the ReadLine module and does not install the Readline-devel module, so just install it
Yum Install Readline-devel-y
Enter the Python3 source directory, recompile
Make
Make install
--------------------------------------------
Tab Auto-complete
Installing ReadLine
Yum Install readline*-y
Create a Pythonstartup file, place it anywhere, I put it under/usr/local/python3.
# python startup fileimport sysimport readlineimport rlcompleterimport atexitimport os# tab Completionreadline.parse_and _bind (' Tab:complete ') # History filehistfile = Os.path.join (os.environ[' HOME '), '. Pythonhistory ') Try:readline.read_ History_file (histfile) except IOError:passatexit.register (Readline.write_history_file, histfile) del os, Histfile, ReadLine, Rlcompleter
Adding environment variables in ~/.bash_profile
Export Pythonstartup=/usr/local/python3/pythonstartup
Refresh Configuration
source. bash_profile
Problems with Linux Python