摘要: __doc__用法 def fun1(): """This is a fun1""" pass class Debug: """This is a class for debugging""" def __init__(self): """ This funtion only has one pro 阅读全文
posted @ 2024-01-07 22:56 lxd670 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1.__getattr__ 和 __getattribute__区别 1.__getattr__ 在访问对象的属性而属性不存在时触发。它只会在属性不存在时调用,而对已存在的属性访问不会触发。 2.__getattribute__ 在访问对象的任何属性时都会触发。无论属性是否存在,每次属性访问都会经过 阅读全文
posted @ 2024-01-07 02:50 lxd670 阅读(4) 评论(0) 推荐(0) 编辑
摘要: docker网络驱动 1.bridge(桥接网络驱动):这是Docker默认使用的网络驱动,它通过docker0网桥连接到宿主机,并为容器分配IP地址,使得容器可以互相通信和与宿主机通信。 2.host(主机网络驱动):使用主机网络驱动时,容器与宿主机共享网络命名空间,容器可以直接使用宿主机的网络接 阅读全文
posted @ 2024-01-07 01:46 lxd670 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 1.GO ENV 查看env值 go env GO111MODULE="on" GOARCH="arm64" ... 设置env Go 1.13 及以上(推荐) # 开启GO mod 和设置go模块代码 $ go env -w GO111MODULE=on $ go env -w GOPROXY=h 阅读全文
posted @ 2024-01-07 01:46 lxd670 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1.python类 类本质是一个字典(本质使用空间换时间) class A: def __init__(self, x) -> None: self.x = x a = A(1) print(a.x) # 1 # 添加y属性 a.y = 2 print(a.y) # 2 print(a.__dict 阅读全文
posted @ 2024-01-07 01:34 lxd670 阅读(2) 评论(0) 推荐(0) 编辑