class Screen(object): @property # 方法作属性调用 def width(self): #方法 width return self._width #实例变量 _width @width.setter def width(self, value): self._width = value @property # 方法作属性调用 def height(self): #方法 width return self._height #实例变量 _width @height.setter def height(self, value): self._height = value @property def resolution(self): return self._width*self._height
Sign in to make a reply
AL