-4
How can I pass a parameter named from
? The object ET.Element
allows me to pass various parameters that will be attributes of my element in XML, but how to use a name that is a language keyword, such as the from
? In doing from="A"
gives syntax error.
root = ET.Element("root")
root.append(ET.Element('vType',id="F21a-17-00", color="0,0,255", begin="0" ,end= "900" ,period="900" ,type="automovel", departLane = "random" , from="A" ,to="b"))
tree = ET.ElementTree(root)
tree.write("filename.xml")
Makes the mistake:
Syntaxerror: invalid syntax
I hope that with the issue reverts this vote in question. I honestly do not understand why she deserved so many negative votes.
– Woss