easydict——安装和功能简介
安装
pip install easydict
安装非常简单
功能:
功能我感觉有点鸡肋,类似dict数据结构的高级使用方式,可以帮助减少原本dict数据结构复杂的使用方法。
实例如下,期望帮助读者理解。
>>> d.others
{'lords': 100, 'peasants': 10000}
>>> d.others.loard
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'EasyDict' object has no attribute 'loard'
>>> d.others.lord
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'EasyDict' object has no attribute 'lord'
>>> d.others.lords
100
>>>