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 code:
while not self._stopevent.isSet( ):
re=¶ÁȡϲãÏûÏ¢
if re>0:
´¦Àí
else:
pass
¼ÙÈ ......
ÎÒÓÃ
#include "python.h"
Py_Initialize();
PyRun_SimpleString("execfile('x.py')");
Íâ´øpython2.6.dllÕâÖÖ·½Ê½ÈÃc++ǶÈëpython£¬·¢²¼³ÌÐòµÄʱºò£¬¾ÓÈ»»¹ÊÇҪװpython£ ......
d = {"a":"a","b":"b","c":"c"}
print d
ΪʲôÊä³öÊÇ:{'a': 'a', 'c': 'c', 'b': 'b'} ......
ÏêϸÐÅÏ¢Çë²é¿´:
http://blog.csdn.net/lgg201/archive/2009/10/08/4643635.aspx
Let's-python-ϵÁÐÊÓƵ·¢²¼×¨Ìù ÊÕ²Ø
ÊÓƵ½ÏÔçµÄʱºò¾Í˵ÊÇҪ¼ÁË, ÕâÒ»ÖܼÁ˵ÚÒ»¼¯, ÓÉÓÚµÚÒ»´Î¼ÊÓƵ, ......