2024-07-03 05:44:23 发布
网友
我在Django有一个项目,我在我的模块、类和函数中编写docstring。但我需要一种方法从那里自动提取所有__doc__。就像“Python”管理.pycollectstatic”,但对于所有.py代码的.__doc__实例。像那样的?有什么想法吗?在
__doc__
.py
.__doc__
让你一睹^{}
示例模块:
# foo.py def bar(): """this is the docstring for bar()""" print 'hello' def baz(): """this is the docstring for baz()""" print 'world'
现在可以使用以下命令打印docstrings:
也可以生成HTML帮助文件:
看起来像这样:
让你一睹^{}
示例模块:
现在可以使用以下命令打印docstrings:
^{pr2}$也可以生成HTML帮助文件:
^{3}$看起来像这样:
相关问题 更多 >
编程相关推荐