class Screen(object):
def __init__(self, **kw):
self.width = kw.get('width', 2880)
self.height = kw.get('height', 1800)
# 你还可以在下面为任何属性设置初默认值
screen1 = Screen()
screen2 = Screen(width=1080)
screen3 = Screen(width=1400, height=900)
screen4 = Screen(height=2100)
python构造函数
最新推荐文章于 2024-08-15 01:55:01 发布