python查看一个对象可用的方法
来源:互联网 发布:芒果店淘宝首页模板 编辑:程序博客网 时间:2024/06/14 09:51
内置函数dir()
例如字符串:
>>> dir('sting')['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
数字:
>>> dir(100)
['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__format__', '__getattribute__', '__getnewargs__', '__hash__', '__hex__', '__index__', '__init__', '__int__', '__invert__', '__long__', '__lshift__', '__mod__', '__mul__', '__neg__', '__new__', '__nonzero__', '__oct__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdiv__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'imag', 'numerator', 'real']
- python查看一个对象可用的方法
- python查看可用模块
- 查看手机的jsr75是否可用方法
- 玩转树莓派_如何查看python有哪些可用的包
- python:判断一个对象是否可迭代 的方法
- 查看python关键字的方法
- 查看python关键字的方法
- linux查看可用串口方法
- 查看系统TPM是否可用的一种白痴型方法
- Linux下查看串口是否可用的笨方法
- ##########(python 解析参数方法 可用) Python optionParser模块的使用方法 #######
- python查看模块,对象的函数
- 如何查看一个java对象的大小
- python编写的一个日历 签到中可用
- sql server 查看对象定义的方法
- js查看对象属性的方法
- 如何查看Javascript原生对象的方法?
- 判断JavaScript对象是否可用的正确方法
- LNMP下为Nginx目录设置访问验证的用户名密码
- 第6周作业1-闰年之循环判断(网络131黄宇倩)
- Win7系统的笔记本u盘数据如何恢复
- 7.6 Displaying Custom Pins on a Map View
- Java正则之贪婪匹配,惰性匹配
- python查看一个对象可用的方法
- ubuntu12.04输入法问题--安装多个输入法之后出现输入法经常不能调出
- nopcommerce笔记:添加数据表及相关配置
- 高新技术与光学测量仪
- StringBuffer的delete方法
- Android开机启动流程初探
- java并发编程之ThreadPoolExecutor
- 电脑辐射的有效防止方法
- Linux内核的PCI总线驱动程式的实现分析笔记