
下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。@H_403_1@
内存溢出小编现在分享给大家,也给大家做个参考。@H_403_1@
# enCoding=utf-8 def printInfo(info): print unicode(info,'utf-8').encode('gbk') class Person(): name = "" def __init__(self,name): self.name = name; return; def Show(self): printInfo("zhuangbanhao%s" % self.name) class Finery(Person): component = None def __init__(self): return; def Decorate(self,component): self.component = component def Show(self): if(None != self.component): self.component.Show() class BigTrouser(Finery): def Show(self): printInfo("ku_zi") self.component.Show() class TShirts(Finery): def Show(self): printInfo("t_shirt") self.component.Show() def clIEntUI(): xc = Person("xiaocai") bT = BigTrouser() TS = TShirts() bT.Decorate(xc) TS.Decorate(bT) TS.Show() return if __name__ == '__main__': clIEntUI(); 以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。@H_403_1@
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。@H_403_1@ 总结
以上是内存溢出为你收集整理的python的设计模式全部内容,希望文章能够帮你解决python的设计模式所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)