标签:string ring class animal python ini ima running doc
class Animal(object):
"""docstring for Animal"""
def __init__(self, name):
self.name = name
def run(self):
print ‘Animal is running...‘
class Dog(Animal):
"""docstring for Dog"""
def __init__(self,name):
# super(Dog, self).__init__(name)
Animal.__init__(self,name)
def printName(self):
print ‘Name: %s‘ % self.name
kk=Dog("kity")
kk.printName()
kk.run()
标签:string ring class animal python ini ima running doc
原文地址:http://www.cnblogs.com/linkenpark/p/6607118.html