python基础31[docstring]
来源:互联网 发布:果语榨汁机骗局知乎 编辑:程序博客网 时间:2024/06/05 03:44
docstring:
docstring表示源代码的注释,可以被help()函数识别。
以''' axxxx'''的形式存在,可以为多行。
可以给module,class,function增加docstring。
但是docstring必须在所有的内容的最前面,例如如果给module增加docstring,该docstring必须位于文件的最前面。
实例:
'''
# prerequisite:
# based on Python 2.x
# need Python XXX module
# make XXXXX command is in PATH
# usage:
1) change the variables:XXX,XXX
2) thisscript.py arg1 arg2 arg3
# process:
1) step1
2) step2
3) step3
4) step4
5) step5
# know issues:
1) issue1
2) issue2
# prerequisite:
# based on Python 2.x
# need Python XXX module
# make XXXXX command is in PATH
# usage:
1) change the variables:XXX,XXX
2) thisscript.py arg1 arg2 arg3
# process:
1) step1
2) step2
3) step3
4) step4
5) step5
# know issues:
1) issue1
2) issue2
# Other
Any issues or improvements please contact xxx@126.com
'''
import sys
def loop(): pass
if __name__ == '__main__':
print len(sys.argv)
for i in sys.argv:
print i
if not len(sys.argv) == 4 :
print __doc__
else:
loop()
'''
import sys
def loop(): pass
if __name__ == '__main__':
print len(sys.argv)
for i in sys.argv:
print i
if not len(sys.argv) == 4 :
print __doc__
else:
loop()
完!
- python基础31[docstring]
- Python 基础 —— docstring
- Python DocString特性
- Python docstring文档字符串
- docstring
- python中的文档字符串(docString)
- python中的文档字符串(docString)
- Python初学(一)DocString
- python中的文档字符串(docString)
- doxygen + doxypypy + docstring 生成python文档
- Python 中调用函数的Docstring
- 飘逸的python - 代码即文档docstring
- python的循环,pass和DocString
- Python写自动化之使用sphinx提取Python代码docstring
- Python对象的文档字符串(DocString):__doc__的写法和输出方法
- python基础31[python内置函数列表]
- python基础31[__XXX__函数]
- #小练习 输出模块中方法及其docstring
- windows系统自动以某用户登录
- python类库31[进程subprocess与管道pipe]
- C++资料收集
- python技巧31[python中使用enum]
- perl的INC设置
- python基础31[docstring]
- python实例26[计算MD5]
- python类库26[读写Excel]
- HTTP协议解析
- 【转】我奋斗了18年不是为了和你一起喝咖啡
- python26实例[文件copy和自动rename]
- python26实例[根据正则表达式来清理文件夹]
- python26实例[subst然后删除文件夹]
- 基于linux的集群系统LVS