Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get object attribute by string

x = getattr(t, 'attr1')
setattr(t, 'attr1', 21)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #object #attribute #string
ADD COMMENT
Topic
Name
6+8 =