python中dir是什么意义【Python教程】,python,dir
作者:搜教程发布时间:2019-11-27分类:Python教程浏览:28评论:0
导读:python中dir是什么意义?python中dir()函数不带参数时,返回当前范围内的变量、要领和定义的范例列表;带参数时,返回参数的属性、要领列表。假如参数包括要领_...
python中dir是什么意义?
python中dir() 函数不带参数时,返回当前范围内的变量、要领和定义的范例列表;带参数时,返回参数的属性、要领列表。假如参数包括要领__dir__(),该要领将被挪用。假如参数不包括__dir__(),该要领将最大限制地网络参数信息。
dir 语法:
dir([object])
参数申明:
object -- 对象、变量、范例。
返回值
返回模块的属性列表。
以下实例展现了 dir 的使用要领:
>>>dir() # 取得当前模块的属性列表 ['__builtins__', '__doc__', '__name__', '__package__', 'arr', 'myslice'] >>> 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'] >>>
相干引荐:《Python教程》
以上就是python中dir是什么意义的细致内容,更多请关注ki4网别的相干文章!
相关推荐
- python数据类型有哪几种?_Python教程,python
- python针对Excel表格的操作_Python教程,python,excel
- 实例解析Python单元测试及unittest框架用法_Python教程,python,单元测试,unittest框架
- Python如何使用xlrd实现读取合并单元格_Python教程,python,xlrd
- 手把手教你在python中如何使用while True语句_Python教程,python,while true
- 给大家分享一下日常学习python的心得(详解)_Python教程,python
- python如何另起一行?_Python教程,python
- python是一种跨平台、开源、免费的高级动态编程语言,对么_Python教程,python,跨平台,开源,免费,编程语言
- 关于python装饰器的详细介绍_Python教程,python,装饰器
- 推荐几个适合小白学习Python的免费网站_Python教程,python,网站
你 发表评论:
欢迎- Python教程排行
-
- 1python数据类型有哪几种?_Python教程,python
- 2python如何批量处理excel数据?_Python教程,python,excel数据
- 3python针对Excel表格的操作_Python教程,python,excel
- 4在python中导入其它函数库的关键字是什么_Python教程,python,函数库,关键字
- 5python爬虫代码示例分享_Python教程,python,爬虫,代码,示例
- 6Python控制Excel实现自动化办公_Python教程,python,excel,自动化
- 7手把手教你在python中如何使用while True语句_Python教程,python,while true
- 8给大家分享一下日常学习python的心得(详解)_Python教程,python
- 9python中if语句用法_Python教程,python,if语句
- 最新文章
- 广而告之