human
how to access the class variable by string in Python?
assistant
Here is some code to access the class variable `a_string` from a class object `test`

getattr(test, a_string)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.