易截截图软件、单文件、免安装、纯绿色、仅160KB

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:
        &


相关问答:

求助有关python添加mp3标签的问题

这些代码是从Mutagen  官方网站复制过来的。
http://code.google.com/p/quodlibet/wiki/Mutagen
但是我添加ISRC的时候就会出现一下错误
麻烦大侠帮我看看怎么添加ISRC标签呢
#m['ISRC'] = ......

python 的sort

有这么一个版本号的list
version = ['1.0.1', '1.0.2', '1.0.21', '1.2.9', '1.2.11']
我怎么样能对版本号的大小进行排序,获得最大的版本号(1.2.11)
max 或者sor ......

用python进行文件比较的问题

在Python for unix and linux System Administration这本书的第6章的Comparing Data一节提到用filecmp这个模块的cmp函数来判断2个文件是否相同。

如下所示:
Python code:

import filecmp
filecmp.c ......

关于python读列数据

a.txt
文件内容如下(其中空白部分都是以tab键隔开):

om 2 0.68 0.83 0 0 0 0 0 0
pos
ppa 17 0.74 0.9 0 0 0 1 2 2
ppc    2           & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号