开发环境和工具
目录开发环境和工具python工具安装python包管理:pip虚拟环境:virtualenv,virtualenvwrapperpython版本管理:pyenv远程部署工具:fabricPython分布式任务队列:celery编码格式,语法检测pdb(调试器)pythonIDE:2.pycharmpytho...
·
目录
开发环境和工具
python工具
安装python
$ wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
$ tar xvzf Python-2.7.9.tgz
$ cd Python-2.7.9
$ LDFLAGS="-L/usr/lib/x86_64-linux-gnu" ./configure --prefix=/opt/python2.7.9
$ make
$ sudo make instal
Python 将被安装到 /opt/python2.7.9/bin,通过创建虚拟环境时--python=/usr/bin/python3.5 --python参数指定版本路径
包管理:pip
pip3 install -i https://pipy.douban.com/simple/ scrapy
虚拟环境:virtualenv,virtualenvwrapper
+ 安装:apt install virtualenv
+ 创建环境在当前目录下:virtualenv huanjing_name(路径中不要包括中文,否则会有ERROR: virtualenv is not compatible with this system or executable)
+ 创建环境:virtualenv huanjing_name
+ 激活环境:source huanjing_name/bin/activate
+ 退出:deactivate
python版本管理:pyenv
远程部署工具:fabric
Python分布式任务队列:celery
编码格式,语法检测
+ flake8,PyLint,pep8
+ flake8:flake8 name.py
+ PEP 8:<https://www.python.org/dev/peps/pep-0008>
pdb(调试器)
+ import pdb;pdb.set_trace() 引入pdb代码片段,不需要时,可以注掉
pythonIDE:2.pycharm
+ 下载:<http://www.jetbrains.com/pycharm/download/#section=linux>
+ 解压:`tar -xvzf pycharm-community-2017.2.3.tar.gz -C ~`~即为文件解压路径
+ 运行:进入bin目录:`sh pycharm.sh &`
+ 激活码:`http://idea.lanyus.com/`
+ 修改hosts文件:`sudo vim /etc/hosts`中添加`0.0.0.0 account.jetbrains.com`
python tutor:可视化执行pythonhttp://www.pythontutor.com/visualize.html#mode=edit
linux系统
快速启动工具:cerebro,Lauunchy(没用过),albert安装:
+ 网址:https://albertlauncher.github.io/docs/installing/
+ 导入秘钥文件:
```
wget -nv -O Release.key https://build.opensuse.org/projects/home:manuelschneid3r/public_key
apt-key add - < Release.key
apt-get update
```
+ 安装:
```
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/home:manuelschneid3r.list"
sudo apt-get update
sudo apt-get install albert
```
+ 快捷键:linux系统键盘 ,快捷键设置,命令:albert show
命令行工具:zsh配置oh my zsh
+ 安装zsh:sudo apt-get install zsh
+ 安装oh my zsh:`sh -c "$(curl -fsSL [https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"](https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)%22)`
或sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
+ 替换bash:chsh -s /bin/zsh
+ 插件:https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins-Overview
编辑器:vim
通用
版本管理:git
更多推荐
已为社区贡献1条内容
所有评论(0)