I have a class that looks like this:
class HTTP_HEADERS:
ACCEPT = "X-Accept"
DECLINE = "X-Decline"
To get all the variable names out of the class I can do something along the lines of:
members = [
attr for attr in dir(HTTP_HEADER)
if not callable(getattr(HTTP_HEADER, attr))
and not attr.startswith("__")
]
This will return a list of variable names, like so:
["ACCEPT", "DECLINE"]
Now what I want to do, is get the values of those variables into a list. For example the output should be:
["X-Accept", "X-Decline"]
How can I do this successfully?
enum