Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python access class variable by string

# name must be a string
# default is optional
getattr(object, name, default)
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #access #class #variable #string
ADD COMMENT
Topic
Name
2+2 =