使用如下命令:

pip3 install pylint

安装完后可以看到在你的python3的目录底下的Scripts目录下有pylint.exe了

然后就可以使用pylint 评估你的代码了,如:

E:\Learning\AWS\Python>pylint learning.py
No config file found, using default configuration
************* Module learning
C: 7, 0: No space allowed before bracket
print (queue.pop())
^ (bad-whitespace)
C: 8, 0: No space allowed before bracket
print (queue)
^ (bad-whitespace)
C: 9, 0: No space allowed before bracket
print (queue.popleft())
^ (bad-whitespace)
C: 23, 0: No space allowed before bracket
print ("row:")
^ (bad-whitespace)
C: 24, 0: No space allowed before bracket
print (row)
^ (bad-whitespace)
C: 34, 0: Trailing newlines (trailing-newlines)
C: 1, 0: Missing module docstring (missing-docstring)
C: 4, 0: Constant name "queue" doesn't conform to UPPER_CASE naming style (invalid-name)
C: 11, 0: Constant name "freshfruit" doesn't conform to UPPER_CASE naming style (invalid-name)
C: 15, 0: Constant name "matrix" doesn't conform to UPPER_CASE naming style (invalid-name)
C: 30, 0: Constant name "comb" doesn't conform to UPPER_CASE naming style (invalid-name) -----------------------------------
Your code has been rated at 3.89/10

安装完毕可以在PyCharm中关联pylint:

进入PyCharm,从菜单栏,依次进入: File -> Settings -> Tools -> External Tools。

“+”,进行添加。需要填写的部分分别是:“Name”,“Tool Settings -> Programs”、“Tool Settings -> Parameters”、“Tool Settings -> Working directory”。

配置完毕,选择一个Python程序,右键点击,快捷菜单中会有“Extensions Tools -> Pylint”,点击运行即可。输出结果在执行程序结果的窗口(IDE下半部分)。

Pylint 的输出

Pylint的默认输出格式是原始文本(raw text)格式 ,可以通过 -f <format>,--output-format=<format> 来指定别的输出格式如html等等。在Pylint的输出中有如下两个部分:源代码分析部分和报告部分。

源代码分析部分:

对于每一个 Python 模块,Pylint 的结果中首先显示一些"*"字符 , 后面紧跟模块的名字,然后是一系列的 message, message 的格式如下:

1
MESSAGE_TYPE: LINE_NUM:[OBJECT:] MESSAGE

MESSAGE_TYPE 有如下几种:

(C) 惯例。违反了编码风格标准

(R) 重构。写得非常糟糕的代码。

(W) 警告。某些 Python 特定的问题。

(E) 错误。很可能是代码中的错误。

(F) 致命错误。阻止 Pylint 进一步运行的错误。

Python3 安装pylint 及与PyCharm关联的更多相关文章

  1. python3.7安装pylint

    python3.7安装pylint之"setuptools"版本错误 借鉴:错题集(已解决):pyinstaller报错ModuleNotFoundError: No module ...

  2. python3 安装pip提示没有distutils.util模块错误的解决

    Python3 安装pip 提示ModuleNotFoundError: No module named 'distutils.util'   环境ubutun14,python版本是python3. ...

  3. pycharm 关联 maya

    设置pycharm代码自动补全 + pycharm关联maya 一.pycharm 设置 python环境,设置代码自动补全 1.devkit 选择对应版本进行下载https://www.autode ...

  4. python3安装模块,摘自网上

    配置好Python3.6和pip3安装EPEL和IUS软件源 yum install epel-release -y yum install https://centos7.iuscommunity. ...

  5. Python3安装Crypto加密包

    Python3安装Crypto加密包 下载链接 加密包地址 步骤 下载加密包,解压加密包到Python安装目录下Lib\site-packages目录中,尝试在Pycharm中导入 from Cryp ...

  6. python3安装,支持openssl,支持采集https

    python3安装,支持openssl,支持采集https 坑好多,特别是安装的时候,各种不匹配,服务器默认配置是python2,升级3后,采集的时候用到openssl,花了两天也没搞定各种错误,也许 ...

  7. ubuntu16.04 python3 安装selenium及环境配置

    环境 ubuntu16.04 python3 安装selenium sudo pip3 install seleium 默认安装完是支持firefox,但是更新得太慢对于较新的firefox已经不支持 ...

  8. suse11 安装 python3.6 python3 安装步骤

    首先需要去网上下载Python-3.6.4.tgz,libopenssl-devel-0.9.8j-2.1.x86_64.rpm zlib-devel-1.2.7-3.14.x86_64.rpm li ...

  9. CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3

    1.问题:pyhontModuleNotFoundError: No module named '_ctypes'  操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装 ...

随机推荐

  1. Java练习 SDUT - 2669_2-2 Time类的定义

    2-2 Time类的定义 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 通过本题目的练习可以掌握类与对象的定义: 设计 ...

  2. select筛选用户数据

  3. LeetCode113 Path Sum II

    Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given su ...

  4. Ubuntu18.10创建软件图标

    解压下载包都/opt目录 创建并编辑/usr/share/applications/xxx.desktop [Desktop Entry] Encoding=UTF-8 Name=Pycharm Co ...

  5. python isinstance和issubclass,区分方法和函数,反射

    一.isinstance和issubclass 1.isinstance class Animal: def eat(self): print('刚睡醒吃点儿东西') class Cat(Animal ...

  6. 从零学React Native之01创建第一个程序

    本篇首发于简书 欢迎关注 上一篇文章是时候了解React Native了介绍了React Native.大家应该对React Native有个初步的认识. 接下来我们就可以初始化一个React Nat ...

  7. Data Flow-File Read-基本过程

  8. bert 硬件要求

    https://github.com/google-research/bert BERT ***** New May 31st, 2019: Whole Word Masking Models *** ...

  9. behavior planning——12.example cost funtion -lane change penalty

      In the image above, the blue self driving car (bottom left) is trying to get to the goal (gold sta ...

  10. Open Source Projects Released By Google

    Open Source Projects Released By Google Google has released over 20 million lines of code and over 9 ...