Peter Otten, 13.04.2014 10:56:
> from xml.etree import ElementTree as ET
> #root = ET.parse(filename).getroot()
> root = ET.fromstring(data)
> for department in root.findall(".//department"):
> name = department.find("name").text
> desc = department.find("desc").text
name = department.findtext("name")
desc = department.findtext("desc")
> print("{}: {}".format(name, desc))
Stefan
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor