Python中print(__doc__)作用的教程
2017-07-11 09:57
369 查看
作用
输出文件开头注释的内容推广
1)momodule.py"""This is the module docstring.""" def f(x): """This is the function docstring.""" return 2 * x
2)执行
>>> import mymodule >>> mymodule.__doc__ 'This is the module docstring.' >>> mymodule.f.__doc__ 'This is the function docstring.'
参考资料
print(doc) in Python 3 script相关文章推荐
- 2.1 python中的print和raw_input语句 [python入门教程]
- 简明python教程学习笔记之十-DocStrings文档字符串
- 简明python教程 --C++程序员的视角(二):函数及作用域
- Python中的测试模块unittest和doctest的使用教程
- Python基础教程--抽象,函数,参数,递归,作用域
- python中的二进制numpy文件的作用及安装教程
- python教程--__init_.py的作用
- 简明python教程 --C++程序员的视角(二):函数及作用域
- Python基础教程代码与注释P65 5.1 print和import的更多信息
- python中print()的作用
- Python学习入门基础教程(learning Python)--1.2.1 Python输出语句print基本使用 .
- python基础教程共60课-第2课print
- 简明python教程 --C++程序员的视角(二):函数及作用域
- python3 中双递归函数的调用过程详解与print()函数在程序调试过程中的作用
- set在python中的作用
- python的print对编码的处理
- 一篇不错的Python入门教程
- 贴一段老外教程里的python代码,高手就别看了哈。
- Javascript简明教程四 作用域
- 简明 Python 教程--图形软件