How to get this value on xml file using python? (See the xml code) -


this xml file. settings.xml , inside have...

<settings>     <setting id="ipkey" value="1252473100" /> </settings> 

how ipkey value using python? think understandable...

you can use following code particular attribute.

import xml.etree.elementtree et  xml = et.parse('yourfile.xml') root = xml.getroot()  value = root.find('./setting').attrib['id'] 

Comments

Popular posts from this blog

Upgrade php version of xampp not success -

amazon web services - S3 and apache mod_proxy with basic authentication -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -