How to use python str.format inside a string of json format
Python Version 3.5 I'm trying to make an API call to configure a device using json as the format. Some of the json will vary depending on the desired naming, so I need to call a variable in the string. I am able to accomplish this using the old style %s... % (variable) , but not with the new style {}... .format(variable) . Failed EX: (Testing with {"fvAp":{"attributes":{"name":(variable)}}}) a = "\"app-name\"" app_config = ''' { "fvAp": { "attributes": { "name": {} }, "children": [ { "fvAEPg": { "attributes": { "name": "app" }, "children": [ { "fvRsBd": { "attributes": { "tnFvBDName": "default