Python class
来源:互联网 发布:1942芬兰怪物知乎 编辑:程序博客网 时间:2024/05/17 07:21
参考:https://docs.python.org/2/tutorial/classes.html
class MyClass: """A simple example class""" i = 12345 def f(self): return 'hello world'
调用属性:MyClass.i
调用函数:MyClass.f
打印注释:MyClass.__doc__
实例化: x=MyClass()
, 其实调用了默认函数__init__()
x.i,x.f,x.__doc__()
0 0
- python class
- Python Class
- Python Class
- Python - class
- Python class
- python Class
- python-class
- Python Class
- <python>class
- Python-Class
- python object and class
- python.struct helper class
- python Object And Class
- Python[十四]:Class
- 菜鸟学 Python-Class
- python class属性
- python class 用法
- python class 的属性
- 进程里的几个栈
- PostgreSQL 中文资料汇总
- User account has expired
- poj1001
- Linux内核Crash分析
- Python class
- Android 自定义Dialog类,并在Activity中实现按钮监听事件
- 过滤关联表属性
- 关于九宫格的适配布局
- Linux下Graphite的安装及部署
- 数组排序
- 序列化
- Python 实现进程锁
- Hibernate 缓存机制