Reputation: 4706
I am currently writing my XML to another file in the following manner
filepath = folderName + "/config.xml"
config = ET.parse(filepath)
...
config.write(open(folderName + "/config.xml", 'w+b'))
My question is how can I write to the same file that is currently open by ET ?
Upvotes: 1
Views: 72
Reputation: 473863
You can provide the path to the same file you've used to read the XML data from:
config.write(filepath)
Upvotes: 1