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

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -