摘要: enum模块: python enum模块提供了枚举功能。有些编程语言是内置了枚举类型,但python没有内置,只是用enum模块里的Enum类来实现类似功能。 如果不使用枚举,我们一般会采用定义常量的方式来处理。比如下面代码: RED, GREEN, YELLOW = range(3) 下面演示了 阅读全文
posted @ 2025-01-11 18:24 RolandHe 阅读(125) 评论(0) 推荐(0)