python实现类的静态变量的代码示例,python静态,class Captch


class CaptchaImage:    def queue(self,arr=list()):        return arr    def InsertCode(self,code):        self.queue().append(code)if __name__=='__main__':    c = CaptchaImage()    c.InsertCode(1)    b=CaptchaImage()    b.InsertCode(2)    print(b.queue())    print(c.queue())
                                代码执行输出结果为:
[1, 2][1, 2]

<h4>附件:<a href="/uploadfiles/2013/05/14/136852040406153.zip">源代码下载</a></h4>

评论关闭