解释python中的help()和dir()函数
help函数是一个内置函数,用于查看函数或模块用途的详细说明
import copy
print(help(copy.copy))
Help on function copy in module copy:
copy(x)
Shallow copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
None
dir()函数时python的内置函数,dir()函数不带参数时,返回当前范围内的变量、方法和定义的类型列表,带参数时,返回参数的属性、方法列表
print(copy.copy) ['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
解释python中的help()和dir()函数的更多相关文章
- Python中的__init__()和__call__()函数
Python中的__init__()和__call__()函数 在Python的class中有一些函数往往具有特殊的意义.__init__()和__call__()就是class很有用的两类特殊的函数 ...
- python中实现延时回调普通函数示例代码
python中实现延时回调普通函数示例代码 这篇文章主要给大家介绍了关于python中实现延时回调普通函数的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的 ...
- Python中的startswith和endswith函数使用实例
Python中的startswith和endswith函数使用实例 在Python中有两个函数分别是startswith()函数与endswith()函数,功能都十分相似,startswith()函数 ...
- Python中的"缝合器"zip函数:将多个可迭代对象组合成一个迭代器
zip函数将参数中多个可迭代对象中相同序号的元素取出组合成一个元组作为输出列表的一个同样序号的元素,即输出列表的每个元素是一个元组,该元组的元素来源于参数中每个迭代对象的对应序号的元素. 具体可参考: ...
- python中常见的内置函数
map #自定义map函数 def map_test(func, list): res = [] for item in list: res.append(func(item)) return res ...
- python中的__dict__和dir()的区别
Python下一切皆对象,每个对象都有多个属性(attribute),Python对属性有一套统一的管理方案. __dict__与dir()的区别: dir()是一个函数,返回的是list: __di ...
- Python中的print、input函数以及Python中交换两个变量解析
一.Python中的值交换操作 首先明确一点点,Python中的一切都是面向对象的,可以理解为Python的中一切都是对象. 我们知道Java也是面向对象的语言,但是在Java中定义一个值变量如下: ...
- python中进程池和回调函数
一.数据共享 1.进程间的通信应该尽量避免共享数据的方式 2.进程间的数据是独立的,可以借助队列或管道实现通信,二者都是基于消息传递的. 虽然进程间数据独立,但可以用过Manager实现数据共享,事实 ...
- python 中的内置高级函数
1.map(function,iterable) map是把迭代对象依次进行函数运算,并返回. 例子: map返回的十分map对象,需要list()函数转化. 2.exec()函数 执行储存在字符串或 ...
随机推荐
- 344. Reverse String【easy】
344. Reverse String[easy] Write a function that takes a string as input and returns the string rever ...
- vs2015创建webService
- 自动make工具--autotools
自动生成Makefile GNU提供的autoconf和automake两套工具可自动完成符合自由软件惯例的makefile的编写.这样就可以像常见的GNU程序一样,只要使用“./configure” ...
- AD使用技巧
1. 效果显示 3 显示3D效果,2显示2D效果. 2. 阻焊塞孔 双击过孔显示属性 solder Mask Expansions Force complete tenting on top Fo ...
- figure margins too large错误解决
使用Rstudio,遇到下面这个错误: figure margins too large 这是因为界面右下角的“plot”窗口太小,显示不了,将右下角的窗口调大就能解决
- python 集合set remove update add
1. 集合(set):把不同的元素组成一起形成集合,是python基本的数据类型. 集合对象是一组无序排列hashable value:集合成员可以做字典的键. 集合就像是 list 和 dict 的 ...
- 注册通用验证用户filter
/// <summary> /// Mvc注册全局Filter /// </summary> public class FilterConfig { /// <summa ...
- 初窥ElasticSearch
初窥ElasticSearch 官网上面的,不知道讲的是什么.. youtube上面有一个start with,内容是在windows以下跑这个elastic search,然后用一个fidler工具 ...
- 这篇文章主要为大家详细介绍了jQuery密码强度验证控件使用详解的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实例为大家分享了jQuery密码强度验证控件,供大家参考,具体内容如下 <html> <head> <meta http-equiv="Cont ...
- webservice 使用axis2实现
Axis2 是Apache的:使用下载 :org.apache.axis2.eclipse.service.plugin_1.6.2.jar org.apache.axis2.eclipse.code ...