In the code below, There can be multiple figureA.objects; these are represented by the lower case letters in the output. Each of these objects has a dictionary of names and characteristics for their key/values (i.e. shape:circle).
for objectsA in figureA.objects:
thisObjectA = figureA.objects[objectsA]
#print the objects lower-case letter (the shape's identifier)
print objectsA
for attributesA in thisObjectA.attributes:
#print the attribute's for the object name:characteristic
print attributesA, thisObjectA.attributes[attributesA]
The output is:
a
shape circle
fill no
size very large
b
shape plus
fill yes
angle 0
inside a
size small
Instead of printing, how do I create either a new list of strings or a new list of only the values? Lower-case a and b won't be included, of course. It's also important the order is maintained (a's attributes, then b's, etc.)
Any help is much appreciated!