魔法函数学习
class A(): def __init__(self): self.name = {"key": "aaa"} def __getitem__(self, item): return self.name.get(item)obj = A()print(obj["key"])实现迭代class B(): def __init__(self, a_li
from pathlib import Patha = Path(r'E:\python_apps\bk-pipline\x52_merge_workspace\time_flush\client\3droom\A - 1.17.0.xml')b = Path(r'E:\python_apps\bk-pipline\x52_merge_workspace\time_flush')relative_
class Parent(): def __init__(self, name): print(name)class Son(Parent): def __init__(self, name): super().__init__(name)s = Son(name="ccc")
class Goods(): def __init__(self): self._price = "" @property def price(self): return self._price @price.setter def price(self, value): self._price = value @pric
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号