网址:https://www.python.org/downloads/release/python-362/
下载地址:https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
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.4
没什么用
下载readline
#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")
本文出自 “爱生活的小白” 博客,请务必保留此出处http://sf1314.blog.51cto.com/13295031/1978791
原文地址:http://sf1314.blog.51cto.com/13295031/1978791