centos6.5下Python IDE开发环境搭建
来源:互联网 发布:索信达数据 编辑:程序博客网 时间:2024/06/07 22:53
之前学习了一段时间的Python,但所有部署都在windows上。正赶上最近在学习liux,以后Python的继续学习就基于linux了,随便写写记录自己的学习点滴。废话不多说,上大招: 毛主席说过,没有开发环境的Python开发都是耍流氓。
【Python安装】
1.gcc自然少不了,图个方便,直接用“Development Tools”:
yum groupinstall "Development tools"
当然,一些依赖包还是需要的:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
2.安装Python2.7,毕竟很多项目都是python2.x的:
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgztar vxf Python-2.7.11.tgzcd Python-2.7.11./configure --prefix=/usr/localmake && make install
3.安装pip:
wget https://pypi.python.org/packages/ff/d4/209f4939c49e31f5524fa0027bf1c8ec3107abaf7c61fdaad704a648c281/setuptools-21.0.0.tar.gz#md5=81964fdb89534118707742e6d1a1ddb4tar vxf setuptools-21.0.0.tar.gzcd setuptools-21.0.0python setup.py install
安装好setuptools后,安装pip:
wget https://pypi.python.org/packages/41/27/9a8d24e1b55bd8c85e4d022da2922cb206f183e2d18fee4e320c9547e751/pip-8.1.1.tar.gz#md5=6b86f11841e89c8241d689956ba99ed7tar vxf pip-8.1.1.tar.gzcd pip-8.1.1python setup.py install
安装完成后,运行pip,并安装检测程序:
pippip install psutil
4.载入python文件验证
【将VIM配置为python IDE开发环境】
1.查看vim编辑器版本
vim --version
在这一步,你要确保已经满足以下两点要求:
(1) Vim编辑版本应该大于7.3。
(2) 支持Python语言。在所选编辑器的功能中,确保你看到了+python
2.配置 vim alias,使 vim 成为默认的 vi 编辑器:
echo alias vi=\'vim\' >> ~/.bashrcsource ~/.bashrc
3.复制默认的 .vimrc 初始化文件:
cp /usr/share/vim/vim70/vimrc_example.vim ~/.vimrcvi ~/.vimrc set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set autoindent set number
4.下载增强的 Python 语法高亮脚本版本:
wget http://www.vim.org/scripts/script.php?script_id=790mv /usr/share/vim/vim70/syntax/python.vim /usr/share/vim/vim70/syntax/python.vim.oricp python.vim /usr/share/vim/vim70/syntax/
5.对脚本/项目生成 ctag 序列
进入脚本所在目录并执行:
ctag -R *
6.Python 函数、类的自动补全
echo 'autocmd FileType python set omnifunc=pythoncomplete#Complete' >> ~/.vimrcwget http://www.vim.org/scripts/script.php?script_id=850unzip pydiction-1.2.zipcp python_pydiction.vim /usr/share/vim/vim70/ftpluginmkdir /usr/share/vim/vim70/pydictioncp complete-dict pydiction.py /usr/share/vim/vim70/pydiction/vi ~/.vimrc #增加如下两行:let g:pydiction_location = '/usr/share/vim/vim70/pydiction/complete-dict'let g:pydiction_menu_height = 20
在编写 python 程序时,按 TAB 键即可激活自动补全菜单。
7.Python 代码自动折叠
wget http://www.vim.org/scripts/script.php?script_id=515cp python_fold.vim /usr/share/vim/vim70/plugin/vi ~/.vimrc #添加:set foldmethod=indent
具体命令为:
zo: 打开光标位置的折叠代码;
zc: 折叠光标位置的代码;
zr: 将文件中所有折叠的代码打开;
zm: 将文件中所有打开的代码折叠;
zR: 作用和 zr 类似,但会打开子折叠(折叠中的折叠);
zM: 作用和 zm 类似,但会关闭子折叠;
zi: 折叠与打开操作之间的切换命令;
至此,一个vim版本的python IDE环境就搭建完成了,还不赶紧上手试试看。
当行好事,莫问前程
0 0
- centos6.5下Python IDE开发环境搭建
- 如何在windows下搭建python的IDE开发环境
- python集成开发环境IDE搭建
- python集成开发环境IDE搭建
- Centos6.7下 搭建 java 开发 环境
- Python环境搭建之Python+Wing IDE开发环境配置
- python环境搭建-IDE
- 【Python开发】python集成开发环境IDE搭建
- Linux平台下Python的安装及IDE开发环境搭建
- Linux平台下Python的安装及IDE开发环境搭建
- Linux平台下Python的安装及IDE开发环境搭建
- Ubuntu16.04下利用Pycharm和Anaconda搭建Python IDE(集成开发环境)
- Python IDE开发环境
- centos6.5下搭建LAMP环境
- Centos6.5环境下搭建svn服务器
- Centos6.5下源码搭建lnmp环境
- centos6.5下搭建lnmp环境
- centos6.5下搭建lamp环境
- KNN最邻近规则分类算法实践实现【Python实现】
- POJ 3261 Milk Patterns <后缀数组+二分>
- seajs常用的API
- MySQL 修改localhost密码
- centos7 nginx 403 forbidden 原因及解决办法
- centos6.5下Python IDE开发环境搭建
- 设计模式学习之访问者模式
- 数组排序的常见方法
- 使用原生态jdbc查询mysql数据库中用户表的记录
- notepad++ 操作实例
- label的用法
- HZAU 1209 Deadline (技巧)
- learning python in the hard way习题6~10的附加题练习
- java操作图片生成水印