Python DocString特性
2011-11-27 20:08
375 查看
#!/usr/bin/python #Filename:func_doc.py def printMax(x,y): '''Prints the maximum of two numbers the two valuse must be integers''' x = int(x) y = int(y) if(x > y): print x,'is maximum' else: print y,'is maximum' printMax(3,5) print printMax.__doc__
在函数的第一个逻辑行的字符串是这个函数的 文档字符串 。注意,DocStrings也适用于模块和
类,我们会在后面相应的章节学习它们。
相关文章推荐
- python中的文档字符串(docString)
- python中的文档字符串(docString)
- Python写自动化之使用sphinx提取Python代码docstring
- python访问类中docstring注释的实现方法
- python 单行注释/多行注释/代码间注释/特殊注释/"""doc String
- Python对象的文档字符串(DocString):__doc__的写法和输出方法
- python基础31[docstring]
- python-property、docstring--笔记
- python访问类中docstring注释的实现方法
- doxygen + doxypypy + docstring 生成python文档
- Python 基础 —— docstring
- python基础31[docstring]
- #小练习 输出模块中方法及其docstring 分类: python 小练习 divide into python 2013-11-05 18:17 451人阅读 评论(0) 收藏
- Python Special Syntax 2:天才级的文档互动DocString
- Python docstring文档字符串
- 短小精悍的python docstring as test的例子 doctest module,写优雅代码必备
- Sublime-Text-2-pydocstring --- 自动生成python docstring的插件
- Python 中调用函数的Docstring
- python中的文档字符串(docString)
- python中的文档字符串(docString)