Convert hash to struct
lie.1296 at gmail.com
Fri Jun 19 16:55:08 EDT 2009
Amita Ekbote wrote:
> I am retrieving values from a database in the form of a dictionary so
> I can access the values as d['column'] and I was wondering if there is
> a way to convert the hash to a struct like format so i can just say
> d.column. Makes it easier to read and understand.
I just remembered something...
If you used python > 2.6, you may also look at namedtuple
More information about the Python-list