摘要: #!/usr/bin/env python #-*-coding:utf8-*- def bulk(self): print("%s is jiao ...."%self.name) class Dog(object): def __init__(self,name): self.name=name 阅读全文
posted @ 2020-02-20 14:41 w_boy 阅读(122) 评论(0) 推荐(0) 编辑
摘要: hostnamectl --static set-hostname k8s-master01 安装依赖包 yum install -y iptables-services && systemctl start iptables && systemctl enable iptables && ipta 阅读全文
posted @ 2020-02-20 13:09 w_boy 阅读(272) 评论(0) 推荐(0) 编辑
摘要: # 对于类方法,第一个参数必须是类对象,一般以cls作为第一个参数 # 当方法中需要使用类对象(如访问私有类属性等)时,定义类方法 # 类方法一般和类属性配合使用 class Dog(object): __name = "alex" @classmethod def eat(cls): return 阅读全文
posted @ 2020-02-20 13:02 w_boy 阅读(108) 评论(0) 推荐(0) 编辑