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 –