显然我在这里缺少一些严肃的东西.这是我的测试程序:
"""
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()
Run Code Online (Sandbox Code Playgroud)
我运行它并打印出"Hello world",natch.但是pydoc.py test.py给出这个:
no Python documentation found for 'test.py'
Run Code Online (Sandbox Code Playgroud)
显然我在这里缺少一些简单的东西,但是什么呢?
--edit-- Per Vishnu的建议我print t.__doc__在文件的最后一行添加了" ",现在运行该文件给出了:
Hello world
class documentation goes here
Run Code Online (Sandbox Code Playgroud)
但是pydoc仍然没有找到任何文档.
| 归档时间: |
|
| 查看次数: |
5285 次 |
| 最近记录: |