Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/313.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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 Pydoc没有看到docstring?_Python_Pydoc - Fatal编程技术网

Python Pydoc没有看到docstring?

Python Pydoc没有看到docstring?,python,pydoc,Python,Pydoc,很明显我错过了一些重要的事情。这是我的测试程序: """ Doc and nothing but doc """ class TestMe(object): """ class documentation goes here """ def testFunc(self): """ FunctionDoc Goes here """ print "Hello world" if __name__ =

很明显我错过了一些重要的事情。这是我的测试程序:

"""
Doc and nothing but doc
"""

class TestMe(object):
    """
    class documentation goes here
    """
    def testFunc(self):
        """
        FunctionDoc Goes here
        """
        print "Hello world"

if __name__ =="__main__":
    t=TestMe()
    t.testFunc()
我运行它,它会打印“你好,世界”,纳奇。 但是
pydoc.py test.py
给出了:

no Python documentation found for 'test.py'
很明显,我在这里遗漏了一些简单的东西,但是什么呢

--编辑-- 根据毗瑟奴的建议,我在文件的最后一行添加了“
print t t.\uuuuuu doc\uuuuuuuu
”,现在运行该文件给出了以下信息:

Hello world

    class documentation goes here

但是pydoc仍然找不到任何文档。

pydoc需要模块名,而不是文件名。尝试
pydoc测试


如果参数中有斜杠,它将使用该参数作为文件名:
pydoc./test.py

您是否尝试了
TestMe.\uuuuu doc\uuuu
?您是否尝试了此处发布的解决方案?是的,这就是我在发布这篇文章之前看到的。为什么我觉得我上面的测试脚本是正确的。宾果!我知道这一定很简单。