Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python for each attribute in object

#Python 2
for attr, value in k.__dict__.iteritems():
        print attr, value

#Python 3
for attr, value in k.__dict__.items():
        print(attr, value)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #attribute #object
ADD COMMENT
Topic
Name
2+9 =