Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python docstring代码块在spyder中未正确显示_Python_Spyder_Docstring - Fatal编程技术网

Python docstring代码块在spyder中未正确显示

Python docstring代码块在spyder中未正确显示,python,spyder,docstring,Python,Spyder,Docstring,根据spyder使用sphinx在帮助窗口中呈现文档字符串的说法,我正在尝试为我编写的python模块创建一个示例代码块。当我尝试使用以下内容创建代码块时: ''' Example: --------- .. code-block :: python :: def testing(): pass ''' 下面是呈现的内容: testing():…应位于突出显示的块内。我不知道如何解决这个问题。。。任何帮助都将不胜感激 所以(经过多次修改后)需要在:下有一个空行:

根据spyder使用sphinx在帮助窗口中呈现文档字符串的说法,我正在尝试为我编写的python模块创建一个示例代码块。当我尝试使用以下内容创建代码块时:

'''
Example:
---------
.. code-block :: python

:: 
    def testing():
        pass
'''
下面是呈现的内容:
testing():…
应位于突出显示的块内。我不知道如何解决这个问题。。。任何帮助都将不胜感激

所以(经过多次修改后)需要在
下有一个空行:

'''
Example:
---------
::

    def testing():
        pass
'''
适当地呈现,
似乎
。。代码块::python
也造成了一些问题,我不知道为什么