DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python get attribute value with name
>>> class User(object): name = 'John' >>> u = User() >>> param = 'name' >>> getattr(u, param) 'John'
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#attribute
ADD COMMENT
Topic
COMMENT
Name
5+1 =
Submit