python读xml文件

# -*- coding:utf-8 -*-
import json
import requests
import os

curpath=os.path.dirname(os.path.realpath(__file__))
xmlpath=os.path.join(curpath,'read1.xml')
with open(xmlpath,encoding="utf-8") as fp:
body=fp.read()
print(body)
原文地址:https://www.cnblogs.com/NiceTime/p/10025543.html