[Tutor] Generating XML using Python
tee chwee liong
tcl76 at hotmail.com
Mon Apr 11 10:47:40 CEST 2011
> Do you want them all in one file? Move the code to create the root element
> and the code to write the file out of the loop.
>
> Do you want to write multiple files? Use a different name from every file.
>
yes i would like to generate 1 xml file by incrementing the port number in the range. i'm confuse why xml is overwritten inside the for loop. i tried to test by writing to a text file, and it works. tq
Port 1
Link speed: 2
Target speed: 3
Port 2
Link speed: 2
Target speed: 3
Port 3
Link speed: 2
Target speed: 3
Port 4
Link speed: 2
Target speed: 3
Port 5
Link speed: 2
Target speed: 3
Port 6
Link speed: 2
Target speed: 3
Port 7
Link speed: 2
Target speed: 3
Port 8
Link speed: 2
Target speed: 3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110411/84cc3cee/attachment.html>
More information about the Tutor
mailing list