Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

iterate through objects with python

class C:
    a = 5
    b = [1,2,3]
    def foobar():
        b = "hi"    

for attr, value in C.__dict__.iteritems():
    print "Attribute: " + str(attr or "")
    print "Value: " + str(value or "")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #iterate #objects #python
ADD COMMENT
Topic
Name
2+8 =