1
我有一个元组,我将其转换为字典。结果是例如:Python:为词典/元组添加值
{'test-rz-01.test.de': '10.60.1.100','test2.test.de': '10.60.1.10’}
我现在需要“静态”的内容添加到每个条目,这样它看起来像类型的字典列表:
[{'name': 'test-rz-01.test.de', 'ipv4addr':'10.60.1.100', 'view':
'External', 'zone': 'test.de'}, {'name': 'test2.test.de', 'ipv4addr':
'10.60.1.10’, 'view': 'External', 'zone': 'test.de'}]
什么是“最好”的方式完成这个?
请发表您的代码,并告诉我们你卡住了。您还应该访问http://stackoverflow.com/help/how-to-ask和http://stackoverflow.com/help/mcve –