摘要:
class A: # 静态字段和classmethod构成单例模式 __v = None @classmethod def get_instance(cls): if cls.__v: return cls.__v else: cls.__v = A() return cls.__vobject1 阅读全文
摘要:
# 二元字符:. ^ $ * + ? { } [ ] | ( ) \ # 模糊匹配 import re# . 通配符print(re.findall("w..l","wedfldsafwlll"))# ['wlll']# ^ 首字符print(re.findall("^h....", "heirkd 阅读全文