目前有2 和 3
有不少企業用的代碼是2版本,隨着技術的發展,之後用3的會成爲大趨勢前端
yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz tar -xvf Python-3.7.3.tar
cd Python-3.7.3 ./configure --prefix=/usr/local/python37 --enable-optimizations make && make install
... 此處省略上面的代碼 ... export PATH=$PATH:/usr/local/python37/bin ... 此處省略下面的代碼 ...
source .bash_profilepython
root@jenkins:/data/Python-3.7.3# python3 Python 3.7.3 (default, Dec 6 2019, 23:40:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() root@jenkins:/data/Python-3.7.3# python Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
好處在於能夠tablelinux
pip install ipython 或 pip3 install ipython
https://www.sublimetext.com/sql
經過快捷鍵Ctrl+`或者在View菜單中選擇Show Console打開控制檯,輸入下面的代碼。 sublime 3瀏覽器
import urllib.request,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib.request.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())
sublime 2bash
import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp)ifnotos.path.exists(ipp)elseNone;urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read());print('Please restart Sublime Text to finish installation')
在瀏覽器中輸入 https://sublime.wbond.net/Package%20Control.sublime-package 下載包管理工具的安裝包,並找到安裝Sublime目錄下名爲"Installed Packages"的目錄,把剛纔下載的文件放到這個文件加下,而後重啓Sublime Text就搞定了。工具
安裝插件。經過Preference菜單的Package Control或快捷鍵Ctrl+Shift+P打開命令面板,在面板中輸入Install Package就能夠找到安裝插件的工具,而後再查找須要的插件。咱們推薦你們安裝如下幾個插件:ui
SublimeCodeIntel - 代碼自動補全工具插件。 Emmet - 前端開發代碼模板插件。 Git - 版本控制工具插件。 Python PEP8 Autoformat - PEP8規範自動格式化插件。 ConvertToUTF8 - 將本地編碼轉換爲UTF-8。編碼