x001-版本介绍

python版本介绍

目前有2 和 3
有不少企业用的代码是2版本,随着技术的发展,之后用3的会成为大趋势前端

python3的安装

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

修改用户目录下名为.bash_profile的文件,配置PATH环境变量并使其生效

... 此处省略上面的代码 ...
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.
>>>

ipython的安装

好处在于能够tablelinux

pip install ipython 或
pip3 install ipython

sublime Test的安装

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。编码

相关文章
相关标签/搜索