Python: How much you need to write to write XML

I am writing a python module that writes data to an XML file. A piece of code that processes the record:

from xml.dom.minidom import Document #using DOMXml main = Document() #create an XML Document toFile = open('output.xml','w') main.writexml(toFile, indent =' ', newl="\n") #writexml() is the operation from Document that was imported toFile.close() 

The final output.xml is 422 bytes in Gentoo OS. Given that the default Gentoo block size is 1024 bytes. I am wondering how many writes to the disk a piece of code generates (since it depends on the file operation).

Thanks!

+4
source share
1 answer

Run the program under strace to find out.

+3
source

All Articles