Skip to content
枚举
2025年3月13日 root
py
from enum import Enum # pip install enum34
class Build(Enum):
    debug = 200
    build = 400
  1. string to enum a=Build['debug'] output: '400'

  2. enum to string a.name output: 'debug'

  3. .int to enum b=Build(400)

  4. enum to int b.value

Last updated: