Python Enum 枚举 用法汇总 import os import sys if sys.version_info.major + sys.version_info.minor * 0.1 < 3.4: from enum34 import Enum else: from enum import Enum class MyColorEnum(Enum): red = 1 red_alias = 1 blue = 2 green = 'green' MyColorEnum.red.name…