I want to format a string and be able to use the dot operator, so that I can construct template strings containing e.g. {user.name}, {product.price}.
I tried this:
'Hello {user.name}'.format( {'user': { 'name': 'Markus' } } )
KeyError: 'user'
'Hello {user.name}'.format( **{'user': { 'name': 'Markus' } } )
AttributeError: 'dict' object has no attribute 'name'
Is there a way to do it?