I mainly use:
from xml.etree import ElementTree as ET
path = 'C:\cool.xml' et = ET.parse ( path )
But I'm not sure how to get root from et?
You probably want:
et.getroot()
Check out the official ElementTree docs on the effbot website . Note that Python 2.5 (the first version of Python to include ElementTree out of the box) uses ElementTree 1.2, not later 1.3. There are not many differences, but only FYI in case.
root = et.getroot()
I would recommend using lxml.etree instead of xml.etree.ElementTree, since lxml is faster and the interface is the same.
Source: https://habr.com/ru/post/1705431/More articles:How can I fade out and then set focus in jQuery? - jqueryJava implementation of planarity testing / planar implementation - javaHow to add custom website to custom view aspx page in list definition project - sharepointWhy is the maximum varchar length less than 8000 bytes? - typesJava servlet filter does not work at login - javaОшибка EXC_BAD_ACCESS при выпуске NSXMLParser - xmlprogrammatically adding and removing events from GridView - asp.netSqlConnection leak diagnosis? - .netWhat artificial neural network or “biological” neural network library / software do you use? - artificial-intelligencethe database connection does not work when the service starts at boot, but works when it starts manually - .netAll Articles