- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Python 的新手(来自 C++),在 Brackets 中运行一些测试代码。现在 pylint 提示说:
C0111 > Missing module docstring [missing-docstring @ 1,0]
所以我尝试安装它:
Manuelas-MacBook:~ manu$ sudo -H pip install docstring
Collecting docstring
Downloading docstring-0.1.2.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-ex4m9h3o/docstring/setup.py", line 2, in <module>
import docstring
File "/private/tmp/pip-build-ex4m9h3o/docstring/docstring/__init__.py", line 11, in <module>
from utils import Endpoint
ModuleNotFoundError: No module named 'utils'
所以我安装了utils:
sudo -H pip install utils
现在我坚持这个:
Manuelas-MacBook:~ manu$ sudo -H pip install docstring
Collecting docstring
Using cached docstring-0.1.2.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-5bn12ekx/docstring/setup.py", line 2, in <module>
import docstring
File "/private/tmp/pip-build-5bn12ekx/docstring/docstring/__init__.py", line 11, in <module>
from utils import Endpoint
ImportError: cannot import name 'Endpoint'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-5bn12ekx/docstring/
而且我真的不知道如何从这里开始。
我最近安装了 python3(在 Mac 上)。我会不会有版本冲突?
Manuelas-MacBook:~ manu$ python --version
Python 3.6.0 :: Anaconda 4.3.1 (x86_64)
Manuelas-MacBook:~ manu$ pip --version
pip 9.0.1 from /Users/manu/anaconda/lib/python3.6/site-packages (python 3.6)
最佳答案
错误信息很不清楚。实际上,pylint
不需要任何额外的模块:它只是希望您记录您的 模块。
您可能想看看 this question禁用此警告。
关于macos - 无法安装模块 'docstring',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43657677/
我是 Python 的新手(来自 C++),在 Brackets 中运行一些测试代码。现在 pylint 提示说: C0111 > Missing module docstring [missing-
我正在写一个宏,它需要一个函数名, 并声明了该函数的几个其他版本。 我想为这些变体提供与原始方法相同的文档字符串, 也许有一些变化。 为此,我需要检索原始方法的文档字符串。 所以我要找的是一个函数:
我正在尝试编写一个列表输出,并将其扩展为 doctest 中的多行。但实际输出与我的预期并不相符。 这是我的代码。 def make_board(dimension: int, queens: lis
在下面的代码中: def read_file(filename): """ >>> read_file('text.txt') {'Donald Trump': [('Dona
为什么字节字符串 b'string' 不能用作类或函数的文档字符串(从某种程度上说我猜是模块)? 恰当的例子: >>> class Foo: ... b"""My Foo class for
我正在编写一个需要调用脚本文档字符串的模块。到目前为止,我已经设法使用 获取了调用脚本的文件名 import inspect filename = inspect.stack()[1].filenam
我想在我的命令行应用程序中获取文档字符串,但每次我调用内置的 help() 函数时,Python 都会进入交互模式。 如何获取对象的文档字符串并且不让 Python 获取焦点? 最佳答案 任何文档字符
我使用 Google-Style Python Docstring 格式已有一段时间了。我一直在处理没有参数的函数/方法的方式突然对我来说看起来不正确。我做了一些搜索,但在网上找不到任何说明如何处理这
如何将代码嵌入到文档字符串中,以告诉 Sphinx 格式化代码,就像在 Markdown 中所做的一样(不同的背景颜色,等宽的无字体)?例如记录一个代码使用示例。 """ This is a modu
我知道 Racket 不像许多其他语言那样具有“文档字符串”,但考虑到在源代码记录事物的便利性,我想在 Racket 中近似类似的东西。 当我第一次了解 Scribble 和#langs 时,我认为可
我有一个带有函数、文档字符串和文档测试的 Julia 模块文件。我加载它并在 Julia 帮助中显示文档字符串,但 Documenter.jl 找不到文档字符串。 一个示例模块文件,src/my_mo
我正在查看某人的代码,其中到处都是这种“文档字符串”: SLEEP_TIME_ON_FAILURE = 5 """Time to keep the connection open in case of
在尝试遵循我的 DocString 的 NumpyDoc 格式时,我似乎无法弄清楚如何告诉用户参数是关键字参数(即指定为 SomeFunc(theKeyWordArg=100) 而不是 SomeFun
我使用 PyCharm IDE 来协助制作符合 PEP0257 的文档字符串。它提供了两个属性,我不完全理解它们之间的区别/用途: :raise Exception: 此处异常说明 :raises E
我正在尝试正确配置 emacs 来编写我的 Clojure 代码。我的 Emacs 配置基于此 good blog post . 但是,我确实更改了一些设置,例如他正在使用的主题等。我一直在检查以获取
在 Python 中,在对函数进行注释时,可以采用一种更容易自动生成文档的方式。他们将其称为文档字符串。 现在我已经在 Groovy 中创建了一个我想传递的抽象类,是否有一种标准的方式我也应该对其进行
当使用 ?f 或 help(f) 通过 REPL 检查时,用户定义的函数(例如 f)如何具有有意义的打印输出 例如假设我写了以下函数 function f(x::Float64, y::Float64
epydoc 和 Sphinx 文档生成器都允许编码器注释任何/所有函数参数的类型。 我的问题是:当 记录 文档字符串。这不会是strong-typing(编译时检查),但(更有可能)可能被称为fir
我正在尝试添加帮助文本以在我的 python 脚本中运行,类似于为 input() 或 print() 打开括号时的情况。 Docstrings 做类似的事情,但在编写代码时没有用。 请看下图我想要的
谁能告诉我以下文档字符串参数之间的区别? :type 和 :param我见过两者都被用来指定方法参数的类型,但我认为它们的作用并不完全相同。其中一个用于程序员,另一个用于 IDE 或类似的东西吗? :
我是一名优秀的程序员,十分优秀!