码迷,mamicode.com
首页 > 编程语言 > 详细

python中使用pycharm2018工具安装Autopep8

时间:2018-11-23 10:14:59      阅读:477      评论:0      收藏:0      [点我收藏+]

标签:csdn   ted   html   eps   官方文档   com   工具   files   use   

PEP 8,Style Guide for Python Code,是Python官方推出编码约定,主要是为了保证 Python 编码的风格一致,提高代码的可读性。

这样的资料网上很多,但是大多都是老版本的,2018版本之前。
我使用的是最新版,有很多改动:
详细配置参见:
有两篇文章写得比较符合我的版本:
1.确保两个问题,你的机器已经安装python2.7和pycharm2018
2.同时要安装autopep8.exe
在windown的cmd命令行中运行:pip install autopep8即可
下面两篇文章要搭配起来看,第二篇文章,只看安装pip install autopep8即可
windows安装成功如下

C:\Users\weiruoyu>pip install autopep8
Collecting autopep8
  Downloading https://files.pythonhosted.org/packages/5b/ba/37d30e4263c51ee5a655
118ac8c331e96a4e45fd4cea876a74b87af9ffc1/autopep8-1.4.3.tar.gz (113kB)
    44% |██████████████▍                 | 51kB 10kB/s eta 0:00:0
    53% |█████████████████▎              | 61kB 12kB/s eta 0:0
    62% |████████████████████▏           | 71kB 12kB/s eta
    71% |███████████████████████         | 81kB 14kB/s et
    80% |█████████████████████████▉      | 92kB 15kB/s
    89% |████████████████████████████▊   | 102kB 12
    98% |███████████████████████████████▋| 112kB
    100% |████████████████████████████████| 122k
B 17kB/s
Collecting pycodestyle>=2.4.0 (from autopep8)
  Downloading https://files.pythonhosted.org/packages/e5/c6/ce130213489969aa5861
0042dff1d908c25c731c9575af6935c2dfad03aa/pycodestyle-2.4.0-py2.py3-none-any.whl
(62kB)
    49% |███████████████▊                | 30kB 17kB/s eta 0:00:
    65% |█████████████████████           | 40kB 14kB/s eta
    82% |██████████████████████████▎     | 51kB 14kB/
    98% |███████████████████████████████▌| 61kB
    100% |████████████████████████████████| 71kB
 20kB/s
Installing collected packages: pycodestyle, autopep8
  Running setup.py install for autopep8 ... done
Successfully installed autopep8-1.4.3 pycodestyle-2.4.0
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the ‘python -m pip install --upgrade pip‘ comm
and.

C:\Users\weiruoyu>

Pycharm Autopep8的配置
Pycharm配置autopep8让Python代码更符合pep8规范

详细的内容可以参见:
PEP 8官方文档 -- Style Guide for Python Code
Python PEP8 编码规范中文版

python中使用pycharm2018工具安装Autopep8

标签:csdn   ted   html   eps   官方文档   com   工具   files   use   

原文地址:http://blog.51cto.com/weiruoyu/2320823

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!