pylint

使用 Visual Studio Code(VSCode)搭建简单的 Python + Django 开发环境

孤人 提交于 2020-04-26 07:43:29
写在前面的话 作为有个 Python 菜逼,之前一直用的 Pycharm,但是在主题这一块怎么调整都感觉要么太骚,看起来不舒服,要么就是简直不能看。似乎用大 JB 公司 IDE 的人似乎都不怎么重视主题这个东西。 我个人是那种“喜新厌旧”的,所以看久了 Pycharm 就感觉很难受了,再加上 Pycharm 太笨重了,就换成了以前短时间用过的 VSCode,以前没用是懒得折腾插件,现在闲下来准备折腾一下! 这里放一张我现在的 Pycharm 的配色主题: 闲话少说,进入正题! 创建 Django 测试项目 这里说明一下,配置的是 Python + Django 的环境,所以我会从新建一个测试的 Django 项目开始,算是整体流程再走一遍! 【1】新建一个 Django 项目: 注意,我这里 Python 使用的是 virtualenv 为项目建立的虚拟环境,没用过的照着这个步骤做就行,需要注意那个切换到我们新环境的命令就行 安装配置 VSCode 【1】安装 VSCode: 下载地址:https://code.visualstudio.com/ 根据自己电脑对应的操作系统下载对应的版本即可,至于安装过程也和一般的软件一样,没什么特别需要注意的地方! 安装完成之后打开,最开始的页面是这样的: 这时候就需要我们根据需要安装对应的插件了,这也是整个 VSCode 最出彩的地方

Start PyLint from correct anaconda environment in Visual Studio Code

白昼怎懂夜的黑 提交于 2020-04-13 06:36:53
问题 I'm trying to make PyLint automagically use correct conda environment inside vscode but still getting import errors: [pylint] E0401:Unable to import 'django' , although: I'm starting vscode from correct environment. [1] I have installed Python extension. [2] I have set correct python.path . [3] 回答1: You have to have installed pylint in this conda environment. Activate given environment with activate env_name (Windows) or source activate env_name . Install pylint in this environment: conda

How do I disable “TODO” warnings in pylint?

限于喜欢 提交于 2020-04-08 21:19:24
问题 When running pylint on a python file it shows me warnings regarding TODO comments by default. E.g.: ************* Module foo W:200, 0: TODO(SE): fix this! (fixme) W:294, 0: TODO(SE): backlog item (fixme) W:412, 0: TODO(SE): Delete bucket? (fixme) While I do find this behavior useful, I would like to know of a way of temporarily and/or permanently turn these specific warnings on or off. I am able to generate a pylint config file: pylint --generate-rcfile > ~/.pylintrc I'm just note sure what

How do I disable “TODO” warnings in pylint?

穿精又带淫゛_ 提交于 2020-04-08 21:17:13
问题 When running pylint on a python file it shows me warnings regarding TODO comments by default. E.g.: ************* Module foo W:200, 0: TODO(SE): fix this! (fixme) W:294, 0: TODO(SE): backlog item (fixme) W:412, 0: TODO(SE): Delete bucket? (fixme) While I do find this behavior useful, I would like to know of a way of temporarily and/or permanently turn these specific warnings on or off. I am able to generate a pylint config file: pylint --generate-rcfile > ~/.pylintrc I'm just note sure what

How do I disable “TODO” warnings in pylint?

好久不见. 提交于 2020-04-08 21:15:34
问题 When running pylint on a python file it shows me warnings regarding TODO comments by default. E.g.: ************* Module foo W:200, 0: TODO(SE): fix this! (fixme) W:294, 0: TODO(SE): backlog item (fixme) W:412, 0: TODO(SE): Delete bucket? (fixme) While I do find this behavior useful, I would like to know of a way of temporarily and/or permanently turn these specific warnings on or off. I am able to generate a pylint config file: pylint --generate-rcfile > ~/.pylintrc I'm just note sure what

How do I make pylint recognize twisted and ephem members?

我怕爱的太早我们不能终老 提交于 2020-04-02 12:04:36
问题 I very much like having pylint tell me if I'm using a non-existent member. However, my new project is using both twisted and the ephem modules, which seem to confuse pylint. How can I get rid of these (incorrect) pylint warnings without either turning off E1101 in general, and without sprinkling warning removal comments around every relevant call? E1101: 8,0: Module 'twisted.internet.reactor' has no 'run' member E1101: 49,25:sunrise_next: Module 'ephem' has no 'Sun' member E1101: 63,26:sunset

How do I make pylint recognize twisted and ephem members?

末鹿安然 提交于 2020-04-02 11:54:48
问题 I very much like having pylint tell me if I'm using a non-existent member. However, my new project is using both twisted and the ephem modules, which seem to confuse pylint. How can I get rid of these (incorrect) pylint warnings without either turning off E1101 in general, and without sprinkling warning removal comments around every relevant call? E1101: 8,0: Module 'twisted.internet.reactor' has no 'run' member E1101: 49,25:sunrise_next: Module 'ephem' has no 'Sun' member E1101: 63,26:sunset

How do I make pylint recognize twisted and ephem members?

萝らか妹 提交于 2020-04-02 11:47:52
问题 I very much like having pylint tell me if I'm using a non-existent member. However, my new project is using both twisted and the ephem modules, which seem to confuse pylint. How can I get rid of these (incorrect) pylint warnings without either turning off E1101 in general, and without sprinkling warning removal comments around every relevant call? E1101: 8,0: Module 'twisted.internet.reactor' has no 'run' member E1101: 49,25:sunrise_next: Module 'ephem' has no 'Sun' member E1101: 63,26:sunset

pyls 配置

若如初见. 提交于 2020-02-26 15:54:22
设置代码行为 120 字 ~/.config/pycodestyle pycodestyle 官方文档 https://www.osgeo.cn/pycodestyle/intro.html 在项目级别,a setup.cfg 文件或 tox.ini 如果存在,则读取文件。如果这些文件都没有 [pycodestyle] 节,未加载项目特定的配置。 [pycodestyle] # count = False # ignore = E226,E302,E41 max-line-length = 120 # statistics = True pyls 的main #!/opt/miniconda3/bin/python # -*- coding: utf-8 -*- import re import sys from pyls.__main__ import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main()) python_ls.py 定义了 start_io_lang_server start_tcp_lang_server LINT_DEBOUNCE_S = 0.5 # 500 ms PARENT

PyLint,PyChecker还是PyFlakes? [关闭]

萝らか妹 提交于 2020-02-26 05:25:27
我想获得一些关于这些工具的反馈: 特征; 适应性; 易用性和学习曲线。 #1楼 好吧,我有点好奇,所以我只是在问了问题之后立即测试了3个人;-) 好的,这不是一个非常认真的评论,但我可以这么说: 我在以下脚本中尝试 使用默认设置 的工具(这很重要,因为您可以选择检查规则): #!/usr/local/bin/python # by Daniel Rosengren modified by e-satis import sys, time stdout = sys.stdout BAILOUT = 16 MAX_ITERATIONS = 1000 class Iterator(object) : def __init__(self): print 'Rendering...' for y in xrange(-39, 39): stdout.write('\n') for x in xrange(-39, 39): if self.mandelbrot(x/40.0, y/40.0) : stdout.write(' ') else: stdout.write('*') def mandelbrot(self, x, y): cr = y - 0.5 ci = x zi = 0.0 zr = 0.0 for i in xrange(MAX_ITERATIONS) : temp =