py class
来源:互联网 发布:常用的哈希算法 编辑:程序博客网 时间:2024/06/11 19:28
Tang 继承object类s
class Tang(object):
def __init__(self, n, ph):
self.name = n
self.phone = ph
print 'a new object is created'
def shoot(self, newph):
self.phone = newph
print 'Update phone:', self.phone
Heng继承父类Tang
class Heng(Tang):
def __init__(self, n, ph, id, ema):
Tang.__init__(self, n, ph)
self.idnum = id
self.email = ema
print 'create Heng'
def UpdateEmail(self, em):
self. email = em
print 'update Emial :', self.email
#t = Tang('tang', 12345689)
#t.shoot(987654321)
p = Heng('xiang', 139, 561, 'tang@163.com')
print p.name, p.phone, p.idnum, p.email
print p.UpdateEmail('xianghe@163.com')
- py class
- rational.py: An example Python class
- jython 2.5后, 编译.py文件到.class的方法
- 【wxpython】py:603: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
- py
- py
- py
- py
- py
- py
- py
- Py
- 基于 Django1.10 文档的深入学习(4)—— models.py 之 class Meta
- 在调用外部.py文件class内的函数出现takes exactly 1 argument (2 given)解决方案
- bin2hex.py && hex2bin.py
- web.py (url.py)
- [py]py存放家具
- Xctf之调皮的py-py-py
- C#中常用函数列表
- 往GridView的特点行前添加行作为标签
- 漫谈Linux下的音频问题
- C#语言初级入门
- WinCE下实现一个简单WEB服务器
- py class
- MongoDB Master/Slave 启动脚本(Windows)
- C#面试基础问题
- it人员职业规划
- 用sp_lock诊断SQL Sever的性能问题
- C#教程第一课:简单的欢迎程序
- WinCE下重新设置IP地址无需重新启动
- 海量数据处理专题(二)——Bloom Filter
- 创建Servlet的三种方式