我正在尝试写出一些包含一些特殊字符的XML。我遇到麻烦的地方是当我迭代一个标签列表来创建几个称为tag的元素时。/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 821, in write
serialize(write, self.python2.7/xml/etree/El
我正在尝试使用Python的ElementTree包编写一个XML文件。基本上,我创建了一个名为allDepts的根元素,然后在我的for循环的每次迭代中,我调用一个函数,该函数返回一个deptElement,其中包含一系列关于大学院系的信息。/Versions/2.6/lib/python2.6/xml/etree/ElementTree.py", line 663, in write
s
我有这个问题,AttributeError: type object 'ElementTree' has no attribute 'tostring',我不知道哪里出了问题,我导入字符串,它不工作。是否有其他方法可以将ElementTree对象转换为XML字符串?import osimport globfrom time import strftime
from xml.etree.<