Operation and maintenance of the old thief novice developers to build python development environment ~ ~ ~ ~

Because before learned some Java development, used eclipse, myeclipsce and idea, to pycharm cumbersome and charges of hate. PHP developers sublime look next door with my brother, thinking to himself a whole, but I do not know why download very slow. So he chose vscode, a lightweight ide, and marked with plug-in can also engage in a practice or Java to write a shell script to write, but also supports markdown write documentation, how good. But also free!

Without further ado, Syria, that is entered

Choice of development environment is vscode + python3.6.3
Note: do not choose because I think anaconda anaconda is too big, and version 3.6.3 is because under such a package before take hadoop ecosystem when there is no under the latest version.

vscode installation steps:

vscode can be downloaded directly from the official website
https://code.visualstudio.com/
Here Insert Picture Description
have mac version and windows version linux version available for download, because it is the source download is very fast, and the volume is very small, the latest version is only 56.9MB size .

Installation is not to say, all the way to the next step. Installing the open, you will find is pure English of.
Here Insert Picture Description
Install the plug-in application store, and then restart the vscode will become Chinese.

mounting step python

python环境就安装原版环境,也是从官网下载:https://www.python.org/
Here Insert Picture Description
Here Insert Picture Description
进入页面往下拉,根据系统选择下载的安装包,windows系统下载这两个,一个64位一个32位,根据你自己的系统选择。
Here Insert Picture Description
这边一定记得勾选add to path!!!!!!!
然后就是一路下一步。
安装完在vscode里ctrl+N新建一个文件,保存为.py结尾。vscode右下角会自动提示你安装pylint和选择python环境,有install就点install,有got it就点got it 很快就完了
有多个版本的python环境还可以自如切换~~~

Here Insert Picture Description
至此环境就已经全部搭完了,可以先来个hello world!
Here Insert Picture Description
还有两个插件,flake8和yapf 在下面的终端里面pip install flake8 和pip install yapf 就可以,flake8是代码错误提示,yapf是自动格式化代码。
安装完成之后打开设置,跳转到配置文件。如图所示:
Here Insert Picture Description
添加三行配置:

    "python.linting.enabled": true,
    "python.linting.flake8Enabled": true,
    "python.formatting.provider": "yapf"

添加完成是这样的:(因为是json所以注意一下格式) ctrl+s保存
Here Insert Picture Description
然后就可以开心的写自己的代码了~~~~格式化代码的快捷键是alt+shift+f 因为之前用myeclipsce习惯了所以改成了ctrl+shift+f,修改方式就在首选项的快捷键里。
Here Insert Picture Description

发布了9 篇原创文章 · 获赞 3 · 访问量 592

Guess you like

Origin blog.csdn.net/qq_36464516/article/details/104378476