Python3 安装pylint 及与PyCharm关联
使用如下命令:
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关联的更多相关文章
- python3.7安装pylint
python3.7安装pylint之"setuptools"版本错误 借鉴:错题集(已解决):pyinstaller报错ModuleNotFoundError: No module ...
- python3 安装pip提示没有distutils.util模块错误的解决
Python3 安装pip 提示ModuleNotFoundError: No module named 'distutils.util' 环境ubutun14,python版本是python3. ...
- pycharm 关联 maya
设置pycharm代码自动补全 + pycharm关联maya 一.pycharm 设置 python环境,设置代码自动补全 1.devkit 选择对应版本进行下载https://www.autode ...
- python3安装模块,摘自网上
配置好Python3.6和pip3安装EPEL和IUS软件源 yum install epel-release -y yum install https://centos7.iuscommunity. ...
- Python3安装Crypto加密包
Python3安装Crypto加密包 下载链接 加密包地址 步骤 下载加密包,解压加密包到Python安装目录下Lib\site-packages目录中,尝试在Pycharm中导入 from Cryp ...
- python3安装,支持openssl,支持采集https
python3安装,支持openssl,支持采集https 坑好多,特别是安装的时候,各种不匹配,服务器默认配置是python2,升级3后,采集的时候用到openssl,花了两天也没搞定各种错误,也许 ...
- ubuntu16.04 python3 安装selenium及环境配置
环境 ubuntu16.04 python3 安装selenium sudo pip3 install seleium 默认安装完是支持firefox,但是更新得太慢对于较新的firefox已经不支持 ...
- 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 ...
- CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3
1.问题:pyhontModuleNotFoundError: No module named '_ctypes' 操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装 ...
随机推荐
- Person Re-identification 系列论文笔记(二):A Discriminatively Learned CNN Embedding for Person Re-identification
A Discriminatively Learned CNN Embedding for Person Re-identification Zheng Z, Zheng L, Yang Y. A Di ...
- UVA_490:Rotating Sentences
"R Ie n te h iD ne kc ,a r tt he es r eo fn oc re e s Ia i ad m, . ...
- UVA_401:Palindromes
AC:Time(29ms) C++ 4.8.2 #include<stdio.h> #include<string.h> char * mirstr = "A ...
- select引起的服务端程序崩溃问题
现象: 某个线上的服务最近频繁崩溃.该服务使用C++编写,是个网络服务端程序.作为TCP服务端,接收和转发客户端发来的消息,并给客户端发送消息.该服务跑在CentOS上,8G内存.线上环境中,与客户端 ...
- Python中的socket
socket()模块函数用法 import socket socket.socket(socket_family,socket_type,protocal=0) socket_family 可以是 A ...
- oracle函数 ROW_NUMBER()
[语法]ROW_NUMBER() OVER (PARTITION BY COL1 ORDER BY COL2) [功能]表示根据COL1分组,在分组内部根据 COL2排序,而这个值就表示每组内部排序后 ...
- 云原生生态周报 Vol. 3 | Java 8 ❤️ Docker
摘要: Docker Hub遭入侵,19万账号被泄露:Java 8 终于开始提供良好的容器支持:Snyk 年度安全报告出炉,容器安全问题形势空前严峻. 业界要闻 Docker Hub遭入侵,19万账号 ...
- 2019-6-5-VisualStudio-开启仅我代码调试
title author date CreateTime categories VisualStudio 开启仅我代码调试 lindexi 2019-06-05 19:29:44 +0800 2019 ...
- 伪静态的实现方法:IIS环境下配置
URL 静态化可以提高搜索引擎抓取,开启本功能需要对 Web 服务器增加相应的 Rewrite 规则,且会轻微增加服务器负担.本教程讲解如何在 IIS 环境下配置各个产品的 Rewrite 规则. 下 ...
- 对装饰器@wraps的解释(一看就懂)-- 并对装饰器详解
1. 先看一段代码 def is_login(func): def foo(*args,**kwargs): return func(*args,**kwargs) return foo def te ...