python中dir函数用法分析
2015-04-17 16:13
471 查看
本文实例讲述了python中dir函数用法。分享给大家供大家参考。具体分析如下:
dir 函数返回任意对象的属性和方法列表,
包括模块对象、函数对象、字符串对象、列表对象、字典对象 ...... 相当多的东西。
dir函数示例:
>>> li = [] >>> dir(li) ['append','count','extend','index','insert', 'pop','remove','reverse','sort'] >>> d = {} >>> dir(d) ['clear','copy','get','has_key','items','keys','setdefault','update','values']
希望本文所述对大家的Python程序设计有所帮助。
您可能感兴趣的文章:
相关文章推荐
- Python日志模块logging基本用法分析
- python函数形参用法实例分析
- Python内置函数reversed()用法分析
- python中getaddrinfo()基本用法实例分析
- Python中property函数用法实例分析
- Python可调用对象__call__方法的用法分析
- Python hashlib模块用法实例分析
- Python SQLite3数据库日期与时间常见函数用法分析
- python中偏函数partial用法实例分析
- python中偏函数partial用法实例分析
- Python中super关键字用法实例分析
- Python守护进程用法实例分析
- python协程用法实例分析
- python中enumerate函数用法实例分析
- Python基础教程之内置函数locals()和globals()用法分析
- Python常用模块用法分析
- Python3.x网页分析HTMLParser基础用法
- 有关python下二维码识别用法及识别率对比分析
- Python3中的真除和Floor除法用法分析