我是 python 的新手,我今天下载了程序。我试着说 hello world 但在运行和调试后我遇到了这个问题: 缺少模块文档字符串 Pylint(C0114:缺少模块文档字符串) 所以在这个问题中@ikhvjs 据说他使用了这段代码。但是我不知道我需要在哪里以及如何在用户设置的代码行中编写此代码。我试图在网上找到视频,但找不到。 "python.linting.pylintArgs": [ "--disable=missing-module-docstring", "--disable=missing-class-docstring", "--disable=missing-function-docstring" ] 我在 vscode 中的用户设置: { "editor.tokenColorCustomizations": { "textMateRules": [ { "name": "One Dark italic", "scope": [ "comment", "entity.other.attribute-name", "keyword", "markup.underline.link", "storage.modifier", "storage.type", "string.url", "variable.language.super", "variable.language.this" ], "settings": { "fontStyle": "italic" } }, { "name": "One Dark italic reset", "scope": [ "keyword.operator", "keyword.other.type", "storage.modifier.import", "storage.modifier.package", "storage.type.built-in", "storage.type.function.arrow", "storage.type.generic", "storage.type.java", "storage.type.primitive" ], "settings": { "fontStyle": "" } } ] }, "liveServer.settings.donotShowInfoMsg": true, "workbench.colorTheme": "Dark SynthWave '84", "[python]": { "editor.formatOnType": true } } 我试着在“[python]”之后这样写: "[python]": { "editor.formatOnType": true , "python.linting.pylintArgs": [ "--disable=missing-module-docstring", "--disable=missing-class-docstring", "--disable=missing-function-docstring" ] } } 但它没有用。现在 vs 代码问题说“未知的编辑器配置设置”我如何禁用这个丢失的模块文档字符串?我需要卸载pylint吗?

无法应用此设置,因为它未注册为语言覆盖设置。 无法在一种语言中设置此设置。您可以在设置的末尾添加它,如下所示: "liveServer.settings.donotShowInfoMsg": true, "workbench.colorTheme": "Dark SynthWave '84", "[python]": { "editor.formatOnType": true }, "python.linting.pylintEnabled": true, "python.linting.enabled": true, "python.linting.pylintArgs": [ "--disable=missing-module-docstring", "--disable=missing-class-docstring", "--disable=missing-function-docstring" ]

你可以打开settings.json下面的.vscode文件夹。 将这些代码添加到settings.json: "python.linting.pylintEnabled": true, "python.linting.pylintArgs": [ "--disable=missing-module-docstring", "--disable=missing-class-docstring", "--disable=missing-function-docstring" ] 另一种方法是尝试使用Pylance作为语言服务器: "python.languageServer": "Pylance",

--disable这样使用有效吗?( --disable=foo --disable=bar --disable=baz) 不是吗--disable=foo,bar,baz?从文档中:“您可以通过指定 --disable= 来禁用特定检查器或其某些消息或消息类别。[...] 是检查器名称和消息符号的逗号分隔列表” _