python 字典关联及多级json遍历处理

python 多个字典不同目录数据的关联处理

screen_mcus={
	"xxx": {
		"0001": "hlt-1608",
		"0010": "hlt-1673",
		"0011": "hlt-1675A",
		"0100": "hlt-1619",
		"0101": "hlt-8159",
		"0110": "hlt-jd79651",
		"0111": "hlt-ek79686",
		"1000": "hlt-1677",
		"1001": "hlt-ht001",
		"1010": "hlt-1680",
		"1011": "hlt-1681"
	},
	"xxx": {
		"0001": "km-1608",
		"0010": "km-1673",
		"0011": "km-1675A",
		"0100": "km-1619",
		"0101": "km-8159",
		"0110": "km-jd79651",
		"0111": "km-ek79686",
		"1000": "km-1677",
		"1001": "km-ht001",
		"1010": "km-1680"
	},
	"xxx": {
		"1011": "km-1681",
		"0001": "wf-1608",
		"0010": "wf-1673",
		"0011": "wf-8151",
		"0100": "wf-8154",
		"0101": "wf-8157",
		"0110": "wf-8159",
		"0111": "wf-8176"
	}
}
screen_bisses={"001":"xxx","010":"xxx","011":"xxx"}
for screens in screen_bisses.keys():
    if screen_biss ==screens:
        s=screen_bisses[screens]
        if screen_bisses[screens] in screen_mcus.keys():
            mucs=screen_mcus[screen_bisses[screens]]
            for screensn in mucs.keys():
                if screen_mcu==screensn:
                    print('厂商    :',mucs[screensn])

你可能感兴趣的:(Python学习笔记记录)