DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
access dynamicall to name attribute python
obj = myobject() i = 7 date7 = getattr(obj, 'date%d' % i) # same as obj.date7
Source by coders911.org #
PREVIOUS
NEXT
Tagged:
#access
#dynamicall
#attribute
#python
ADD COMMENT
Topic
COMMENT
Name
5+5 =
Submit