I want a easy form to define multiple constant and enumerate them, so that using only the name of every constant give me the value of the enumeration, similar to enum in C but in Python 3. For example:
harmonic=0
vrms=1
irms=2
.
.
.
and so
I want a easy form to define multiple constant and enumerate them, so that using only the name of every constant give me the value of the enumeration, similar to enum in C but in Python 3. For example:
harmonic=0
vrms=1
irms=2
.
.
.
and so
>>> from enum import Enum
>>> class mycons(Enum):
... vrms=1
... irms=2
...
>>> print(mycons.irms.name)
irms
>>> print(mycons.irms.value)
2