#先建立5个字典, 表示每个位上不同字符代表的意义
err_1 = {'A':'WAN ', 'L':'LAN '}
err_2 = {'A':'11M ', 'B':'11M ', 'G':'11M ', 'N':'11M ', 'H':'54M '}
err_3 = {'L':'Low Channel ', 'M':'Middle Channel ', 'H':'High Channel '}
err_4 = {'P':'Tx Power ', 'E':'EVM ', 'F':'Frequency Error ', 'M':'Mask ', 'R':'PER '}
err_5 = {'0':'Low limit', '1':'Upper limit', '2':'Other error'}
#循环得到errorcode和其意义
errorcode = {}
code = ''
description = ''
for a in err_1:
for b in err_2:
for c in err_3:
for d in err_4:
for e in err_5:
code = a+b+c+d+e
description = err_1[a] + err_2[b] + err_3[c] + err_4[d] + err_5[e]
errorcode[code] = description
print(code,":",description)
#显示每个code和其对应的意义
#for key in errorcode:
# print(key,':' , errorcode[key])
error code 的排列及描述,字典的小应用
最新推荐文章于 2022-02-25 19:38:17 发布