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

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -