打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Sublime配置pylinter实现查错,格式化,代码自动规范,对错误显示图标(python语法检查)

首先使用package control安装pylinter

ctrl+shift+p  ->  package Control:install Package  -> pylinter

下面还要安装 pylint 和 Python  

Python直接从官网下载安装对应系统的文件

然后使用Python的包管理器pip安装Pylinter如下

pip install pylint

配置sublime的pylinter,打开配置,如下图

输入下面配置内容

{    // When versbose is 'true', various messages will be written to the console.    // values: true or false    "verbose": false,    // The full path to the Python executable you want to    // run Pylint with or simply use 'python'.    "python_bin": "python",    // The following paths will be added Pylint's Python path    "python_path": ["D:/Python34/python.exe"这个地方写你的路径                   ],    // Optionally set the working directory    "working_dir": null,    // Full path to the lint.py module in the pylint package    "pylint_path": "D:/Python34/Lib/site-packages/pylint/lint.py",这个地方写你的路径    // Optional full path to a Pylint configuration file    "pylint_rc": null,    // Set to true to automtically run Pylint on save    "run_on_save": true,    // Set to true to use graphical error icons    "use_icons": true,    "disable_outline": false,    // Status messages stay as long as cursor is on an error line    "message_stay": false,    // Ignore Pylint error types. Possible values:    // "R" : Refactor for a "good practice" metric violation    // "C" : Convention for coding standard violation    // "W" : Warning for stylistic problems, or minor programming issues    // "E" : Error for important programming issues (i.e. most probably bug)    // "F" : Fatal for errors which prevented further processing    "ignore": [],    // a list of strings of individual errors to disable, ex: ["C0301"]    "disable": [],    "plugins": []}

重启sublime下面看效果图

由图可知上面的警告和提示太多啦,加入下面配置去掉C 和 R提示。

"ignore": ["R","C"],
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
设置 Sublime Text 的 Python 开发环境
windows下sublime Text 3 做Python编辑器 详细配置
第1天:Python 环境搭建
pylint-可以完全自定义的源代码分析器
sublime text 3 + python配置,完整搭建及常用插件安装
sublime中写python代码
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服