__author__ = "Alex Li"
import os
# os.system()
# os.mkdir()
class Dog(object):
'''这个类是描述狗这个对象的'''
def __init__(self,name):
self.name = name
self.__food = None
# 把一个方法变成一个静态属性
@property #attribute
def eat(self):
print("%s is eating %s" %(self.name,self.__food))
#保证能给属性赋值
@eat.setter
def eat(self,food):
print("set to food:",food)
self.__food = food
#保证能够删除属性
@eat.deleter
def eat(self):
del self.__food
print("删完了")
def talk(self):
print("%s is talking"% self.name)
d = Dog("ChenRonghua")
d.eat
d.eat = 'baozi'
del d.eat