python读xml中元素顺序问题
a.xml内容如下:
</project>
<project name="asdf" branch="asfasdfas" naname="xiao xin" QD6="091010">
<componentList table="cpp">
<entry>ae </entry>
<entry>pl </entry>
<entry>pp </entry>
<entry>ps </entry>
<entry>sa </entry>
</componentList>
<componentList table="java">
</componentList>
</project>
相应的处理函数如下:
def GetexpectData(project,branch):
global locList
global cppcomponentss,componentReposityy;
cppcomponentss= {}
tree = ET.parse("a.xml")
p = getByAttr(tree.findall("project"),"name",project)
if p!=None:
compList = getByAttr(p.findall("componentList"),"table","cpp")
comps = compList.findall("expect")
for each in comps:
&
相关问答:
查看视频详细请点击:
Let's Python系列视频正式发布
谢谢大家的支持, 后续视频将会更加精彩
关注。。。
顶一下睡觉.....
Let's Python 系列视频正式发布了
查看视频详 ......
我现在用的是eclipse 那个插件,可能是因为没配置明白的问题,感觉不好,没有一些必要的功能。
后来我换了Eric4,比eclipse插件好用不少,但是缺少一个我最希望有的功能:代码追踪, ......
我用了def CreateMyDialog(self):
dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......