Following somebody’s helpful advice I have for years used this line of code to write out a file:
tree.write(newname,
encoding=tree.docinfo.encoding,,
xml_declaration=True,
pretty_print=True)
When running a script in Pycharm, its AI suggested just “tree.write(newname)” . I used the simpler form for a document, and it seemed to make no difference to the structure or display of the document.
It’s a lot less to type and certainly easier to remember. Does the specification of features ever make a difference?
Martin Mueller
Professor emeritus of English and Classics
Northwestern University