【发布时间】:2012-07-04 17:43:45
【问题描述】:
例如我的 xml 文件包含:
<layout name="layout1">
<grid>
<row>
<cell colSpan="1" name="cell1"/>
</row>
<row>
<cell name="cell2" flow="horizontal"/>
</row>
</grid>
</layout>
我想从 xml 中检索一个对象 例如返回的对象结构是这样的
class layout(object):
def __init__(self):
self.grid=None
class grid(object):
def __init__(self):
self.rows=[]
class row(object):
def __init__(self):
self.cels=[]
【问题讨论】:
标签: python xml data-modeling objectify