I have a string and a list of objects:
gpl = \"%(id)s : %(atr)s\"
objects = [{\'id\':1, \'content\':[{\'atr\':\'big\', \'no\':2}]}, {\'id\':2, \'content\':
Since your formatting string uses named parameters:
gpl = "%(id)s : %(atr)s"
You need to provide keys (the names) in a dictionary as an argument to reference back to named formatting keys in the formatting string:
print gpl % {'id': obj['id'], 'atr': con['atr']}
So your code would be:
for obj in objects:
for con in obj['content']:
print gpl% {'id': obj['id'], 'atr': con['atr']}