python 文档资源 dir __doc__
来源:互联网 发布:微信红包的随机算法 编辑:程序博客网 时间:2024/06/06 09:35
形式: 角色
#注释 文档中的文档
dir 函数 对象中可用属性的列表
文档字符串:__doc__ 附加在对象上的文件中的文档
PyDoc:help函数 对象的交互帮助
PyDoc:HTML报表 浏览器中的模块文档
>>> import sys
>>> dir(sys)
['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', ...........omited']
>>> sys.__doc__
"This module provides access to some objects used or maintained by the\ninterpreter and to functions that interact strongly with the interpreter.\n\nDynamic objects:\n\nargv -- command line arguments; argv[0] is the script pathname if known\npath ,....................................omited"
使用dir查看内置对象类型提供了哪些属性,可以运行dir并且传入所需要类型的变量,例如查看列表的属性传入空对象即可
>>> dir([])
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
__doc__使用
>>> def squre(data):
"""the squre is a function that.......
"""
return data**2
>>> squre.__doc__
'the squre is a function that.......\n\t'
help的使用
Help on built-in function getrefcount in module sys:
getrefcount(...)
getrefcount(object) -> integer
Return the reference count of object. The count returned is generally
one higher than you might expect, because it includes the (temporary)
reference as an argument to getrefcount().
- python 文档资源 dir __doc__
- 在命令行中查看python帮助文档 --dir、help、__doc__
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
- 在命令行模式下查看Python帮助文档---dir、help、__doc__
- python整理笔记3---__doc__(文档字符串)
- python __doc__
- 零基础学python-14.1 python的文档资源:注释和dir()
- 文档字符串 __doc__
- python __doc__
- python中的__doc__,__name__
- Python中的__doc__
- python __str__(),__dir__(),__doc__
- Python 查看帮助文档 dir(),help()
- python文档帮助help()和dir()
- Python对象的文档字符串(DocString):__doc__的写法和输出方法
- __doc__
- 第十六周项目3用函数指针调用函数
- 在Windows平台VS2013环境下编译Boost库
- ie低版本情况下不能正确的设置iframe高度
- ios8 系统定位问题
- 第十六周OJ项目4指针引出奇数因子
- python 文档资源 dir __doc__
- 16周,项目一,冒泡排序,指针版
- JQuery 判断浏览器及其版本
- 黑马程序员------java基础知识、集合
- Java多线程(一)进程和线程的基础知识
- ios objective-c之-9:字典,可变字典 (NSDictonary NSMutableDictoray)
- easyui隔行变色
- 第十六周 项目一 数组排序(1)
- 黄金分割点的思考