Object-like attribute access for nested dictionary
The following class would let you do what you want (works in Python 2 & 3): class AttrDict(dict): “”” Dictionary subclass whose entries can be accessed by attributes (as well as normally). >>> obj = AttrDict() >>> obj[‘test’] = ‘hi’ >>> print obj.test hi >>> del obj.test >>> obj.test=”bye” >>> print obj[‘test’] bye >>> print … Read more