WIP: script
This commit is contained in:
parent
68acc84c50
commit
1e3cc0c702
2 changed files with 52 additions and 19 deletions
16
test.py
Normal file
16
test.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import xml.etree.ElementTree as ET
|
||||
|
||||
# create the file structure
|
||||
data = ET.Element('data')
|
||||
items = ET.SubElement(data, 'items')
|
||||
item1 = ET.SubElement(items, 'item')
|
||||
item2 = ET.SubElement(items, 'item')
|
||||
item1.set('name','item1')
|
||||
item2.set('name','item2')
|
||||
item1.text = 'item1abc'
|
||||
item2.text = 'item2abc'
|
||||
|
||||
# create a new XML file with the results
|
||||
mydata = ET.tostring(data)
|
||||
myfile = open("items2.xml", "w")
|
||||
myfile.write(mydata)
|
Loading…
Add table
Add a link
Reference in a new issue