
Former-commit-id: 3a0b1aecf3
[formerly 74aafae150f8cd26b383bf37449cc861162ce7f5] [formerly 916991bafcbdcd5096382e11b1a75ca8da4d36ad]
Former-commit-id: 36a8b9b689b6df1a5a9a61de58887b9c7f882100
Former-commit-id: 11eb7d9d63cea49d8dfb82c5d32e67aa694e4f24
15 lines
358 B
Python
15 lines
358 B
Python
from lxml import etree as ElementTree
|
|
|
|
parser = ElementTree.XMLParser(recover=True)
|
|
tree = ElementTree.parse('all.svg', parser)
|
|
polys = tree.xpath('//polygon')
|
|
|
|
text_file = open("test.txt", "wt")
|
|
|
|
for p in polys:
|
|
currentPoints = p.attrib['points']
|
|
currentPoints = currentPoints.replace(" ", ",")
|
|
text_file.write(currentPoints + ",0,0")
|
|
|
|
text_file.close()
|