เช่น
> from attrdict import AttrDict
> a = AttrDict({'foo': 'bar'})
> a.foo
'bar'
> a['foo']
'bar'
และสามารถใช้ AttrDict ที่ช่วยให้คุณสามารถสร้าง dict ย่อย ๆ ใน dict ได้
> attr = AttrDict('foo': {})
> attr['foo']['bar'] = 'baz'
> attr.foo
{'bar': 'baz'}
และอื่น ๆ
โมดูลนี้
- ใช้ MIT License
- รองรับทั้ง Python 2 และ 3
pip install attrdictสามารถอ่านเอกสารได้ที่ https://pypi.python.org/pypi/attrdict/
เขียนที่ https://python3.wannaphong.com/

0 ความคิดเห็น:
แสดงความคิดเห็น
แสดงความคิดเห็นได้ครับ :)