easydict的作用:可以使得以属性的方式去访问字典的值
from easydict import EasyDict as edict a=['8',2,3] a=edict() a.f=99 print(a) a.f=edict() a.q='nihao' a.f.t=99 print(a.f) print(a)
m21文件代码
from easydict import EasyDict as edict f=edict() k=f k.k=50 f.f='dds'
m22文件代码
import main2.m21 as m21 a=m21.f.k print(a) print(m21.k.f) print(m21.f.f)