I have a simple python program meant to write a text file. The code is below: (I truncated most of it, you get the idea)
xml_editor = open('Test.xml', 'w+')
xml_editor.write('<?xml version="1.0"?>\n'
'<Simulation verbosity="debug">\n'
' <RunInfo>\n'
' <Sequence>RUN,PLOT</Sequence>\n'
' <WorkingDirectory>RUNNING1</WorkingDirectory>')
I want to change the working directory argument (RUNNING1) to something else (RUNNING2) under the same Test.xml file, but each time I run the program, the working directory remains "RUNNING1". In short, the w+ is not overwriting/rewriting "Test.xml". Any suggestions on what I can do to fix this? Thanks!