網址:https://www.python.org/downloads/release/python-362/python
下載地址:https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgzsql
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
xz -d Python-3.4.7.tar.xz tar -xf Python-3.4.7.tar #yum install gcc -y ./configure --prefix=/opt/python make && make install --------------------- 用python查看默認安裝路徑 >>> import sys >>> sys.path ['', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages'] -------------------- python3.4默認沒添加path 在/etc/profile最後一行添加 export PATH=$PATH:/opt/python/bin 而後 source /etc/profile #python快捷path就被改了,yum用的python2,麻煩
下載setuptool 3.4以上已經默認安裝了easy_install-3.4ide
沒什麼用spa
下載readlinecode
#yum install -y readline-devel -y #pip install readline
tab補全 #python startup file import readline,rlcompleter #tab completion readline.parse_and_bind('tab:complete') ---------------------------- python歷史記錄 #history file import os history_file = os.path.join(os.environ["HOME"],".pythonhistory")