I wonder if it is better add an element by opening file, search ‘good place’ and add string which contains xml code.
Or use some library… i have no idea. I know how can i get nodes and properties from xml through for example lxml but what’s the simpliest and the best way to add?
I wonder if it is better add an element by opening file, search ‘good
Share
You could use lxml.etree.Element to make the xml node(s), and use append or insert to attach them into xml document:
yields: