企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` import json jsonok = open("treeyuan.json",encoding="utf-8") jsonok1 =json.load(jsonok) #print(jsonok1) dict1 = {} def getjson(k,j): for key in j: #print(j[key]) if(isinstance(j[key],str)): if j[key] == k: #print(j) #dict2 =j.copy() dict1.update(j) if(isinstance(j[key],list)): for i in j[key]: if(isinstance(i,dict)): getjson(k,i) getjson('TreeMapLayout',jsonok1) print(dict1) dict1['value']=8888 print(dict1) ```