f.write(doc.toprettyxml()). 使用这种方式,生成的xml 是不含有encoding的,不能满足我的需要,然后再网络上继续百度,找到了方法二,. with open('.
確定! 回上一頁