Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÖÐÏß³ÌÎÊÌ⣿£¿

ÎÒÏÖÔÚÊÇÕâÑùµÄ
¿ªÁËÒ»¸ö×ÓỊ̈߳¬¶ÁÈ¡ÏÂÃæµÄÏûÏ¢
±¾ÒâÊÇ
Python code:

while not self._stopevent.isSet( ):
re=¶ÁȡϲãÏûÏ¢
if re>0:
´¦Àí
else:
pass

¼ÙÈ ......

c++ǶÈëpython·¢²¼ÎÊÌâ

ÎÒÓÃ
#include "python.h"
Py_Initialize();
PyRun_SimpleString("execfile('x.py')");
Íâ´øpython2.6.dllÕâÖÖ·½Ê½ÈÃc++ǶÈëpython£¬·¢²¼³ÌÐòµÄʱºò£¬¾ÓÈ»»¹ÊÇҪװpython£ ......

python×ÖµäÎÊÌâ

d = {"a":"a","b":"b","c":"c"}
print d

ΪʲôÊä³öÊÇ:{'a': 'a', 'c': 'c', 'b': 'b'} ......

[Ãâ·Ñ·ÖÏí]Let's PythonµÚ¶þ¼¯·¢²¼, ¿ÉÎȶ¨ÏÂÔØ.

ÏêϸÐÅÏ¢Çë²é¿´:
http://blog.csdn.net/lgg201/archive/2009/10/08/4643635.aspx

  Let's-python-ϵÁÐÊÓƵ·¢²¼×¨Ìù ÊÕ²Ø
ÊÓƵ½ÏÔçµÄʱºò¾Í˵ÊÇҪ¼ÁË, ÕâÒ»ÖܼÁ˵ÚÒ»¼¯, ÓÉÓÚµÚÒ»´Î¼ÊÓƵ, ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ