python读xml文件
生活随笔
收集整理的這篇文章主要介紹了
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)
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
總結
以上是生活随笔為你收集整理的python读xml文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 值类型和引用类型---深究
- 下一篇: NOIP练习赛题目5