How to get xml output in a file with new line using python xml.etree?
问题 I am generating xml file using "from xml.etree import ElementTree" and placing the generated output in to a new file "test.xml". The output is getting placed inside the test.xml but there is no new line its a big big line. So, what shall i do to have new line inside "test.xml" . Following is the script: from xml.etree import ElementTree from xml.dom import minidom from lxml import etree def prettify(elem): """Return a pretty-printed XML string for the Element. """ rough_string = ElementTree