python object filed 转换成dict

差点像JAVA那样通过反射迭代属性,python根本不需要这样做,直接通过__dict__,参考overflow上面两篇dict to object,object to dict的文章:

http://stackoverflow.com/questions/61517/python-dictionary-from-an-objects-fields

http://stackoverflow.com/questions/1305532/convert-python-dict-to-object

猜你喜欢

转载自san-yun.iteye.com/blog/1689427