python xml中写入文件如果要带
<?xml version="1.0" encoding="utf-8"?>
字样应该怎么办?
doc = minidom.Document()
f = open(filename, "w")
doc.writexml(f, indent=" ", addindent='\t', newl="\n",encoding="utf-8")
f.close()
python xml中写入文件如果要带
<?xml version="1.0" encoding="utf-8"?>
字样应该怎么办?
doc = minidom.Document()
f = open(filename, "w")
doc.writexml(f, indent=" ", addindent='\t', newl="\n",encoding="utf-8")
f.close()