摘要: 1.安装mingw64 下载地址:https://sourceforge.net/projects/mingw-w64/files/ Toolchains targetting Win64 → Personal Builds → mingw-builds → 8.1.0 ‌64位系统‌ → thre 阅读全文
posted @ 2025-06-29 16:26 zwx901323 阅读(57) 评论(0) 推荐(0)
摘要: 在 Windows 11 系统下,Navicat 15 连接数据库报错 “ERROR: column "datlastsysoid" does not exist”, 是因为 PostgreSQL 15 及以上版本从pg_database表中删除了datlastsysoid字段,而 Navicat 阅读全文
posted @ 2025-04-19 16:47 zwx901323 阅读(1092) 评论(0) 推荐(1)
摘要: 1.元类(Metaclass) 元类是用于创建类的类。它定义了类的创建行为,可以控制类的属性、方法的创建和修改。 1.日志记录:在创建类时自动添加日志记录相关的方法。 class LoggingMeta(type): def __new__(cls, name, bases, attrs): def 阅读全文
posted @ 2024-12-11 10:39 zwx901323 阅读(53) 评论(0) 推荐(0)
摘要: 1.__slots__控制属性访问 class MyClass: __slots__ = ('attr1', 'attr2') def __init__(self): self.attr1 = 10 self.attr2 = 20 # 尝试添加不在 __slots__ 中的属性会报错 obj = M 阅读全文
posted @ 2024-12-11 10:05 zwx901323 阅读(15) 评论(0) 推荐(0)
摘要: 抽象定义 阅读全文
posted @ 2024-12-11 09:43 zwx901323 阅读(7) 评论(0) 推荐(0)
摘要: 多态定义 阅读全文
posted @ 2024-12-11 09:43 zwx901323 阅读(6) 评论(0) 推荐(0)
摘要: 继承定义 阅读全文
posted @ 2024-12-11 09:43 zwx901323 阅读(7) 评论(0) 推荐(0)
摘要: 封装定义 阅读全文
posted @ 2024-12-11 09:43 zwx901323 阅读(6) 评论(0) 推荐(0)
摘要: 1.创建无限循环迭代对象:count,cycle,repeat from itertools import count for i in count(1, 2): if i > 10: break print(i) # 以1开始,2为步长,无限range结果:1 3 5 7 9 from itert 阅读全文
posted @ 2024-12-02 17:09 zwx901323 阅读(10) 评论(0) 推荐(0)
摘要: 1.创建一个简单的hello文件,里面只有一个类A,A属性为name 2.获取文件下面的未知类有哪些? 当只知道需要导入的类名称,但是不知道具体位置,如何动态导入? import importlib.util import inspect # 文件夹下面有个脚本,下面只有一个类: from test 阅读全文
posted @ 2023-07-25 21:54 zwx901323 阅读(9) 评论(0) 推荐(0)