zidong 发表于 2017-4-25 07:45:15

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
页: [1]
查看完整版本: python object filed 转换成dict