我是斯芬克斯的新手。 我面临的情况是,我有一个复杂的函数,在sphinx文档中,我想展示一些直接使用该函数的示例。在
def myComplicatedFunction(status):
"""Here I have a brief description
:param status: explanation
:returns: explanation
"""
<<< code >>>
return statstics
在sphinx部分的某个地方,我想包括一些python代码,它显示示例输入和示例输出。但是无论我做什么(使用``或:)作为文档,它都不能得到语法高亮显示。它只是作为一个简单的文本,使阅读困难。在
我应该如何在sphinx中包含python代码示例?
适用于python,但请确保安装了pygments。在
在somethingconf.py配置文件这两个语句很有趣:
^{pr2}$根据输出,写下
模拟Python交互会话;以
>>>
开头的块将自动视为Python源代码:相关问题 更多 >
编程相关推荐