我有下面的代碼在我的JSON合併值合併JSON:與Python
from jsonmerge import merge
with open('env.json') as data_file:
data = json.load(data_file)
result2 = merge("", data.get('default_attributes'))
result3 = merge(result2, data.get('normal_attributes'))
result4 = merge(result3, data.get('override_attributes'))
result5 = merge(result4, data.get('force_override_attributes'))
> print result4, result5
result6 = merge(result5, data.get('automatic_attributes'))
cookbook_versions = {"cookbook_versions" : data.get('cookbook_versions')}
result7 = merge(result6, cookbook_versions)
現在,當我打印result4,result5我得到:
result4 = {u'modmon「:{ u'env':u'dev'},u'default':{u'env': u'developmen-jq'},u'paypal':{u'artifact':u'%5BINTEGRATION%5D'} , u'windows':{u'password':u'Pib1StheK1N5'},u'task_sched': {u'credentials':u'kX?rLQ4XN $ q'},u'seven_zip':{u'url ': u'https://.io/artifactory/djcm-zip-local/djcm/chef/paypal/7z1514-x64.msi '}, u'7拉鍊':{u'home ':U' %SYSTEMDRIVE%\ 7-拉鍊'}}
result5 =無
不使感我在result5中我正在合併已經有內容的結果4,爲什麼它會出現null?
我希望這是一個假的密碼...... – ffarquet
燁刪除,並是假的。 :D – Scooby