Xml解析python Xml.etree.ElementTree

2024-09-29 01:21:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用python读取xml文件。我使用jupyter来运行代码,当我运行它时,电脑卡住了(它没有响应,没有显示任何错误)。xml文件与我的jupyter笔记本位于同一文件夹中

该文件有超过250000行和150列

import xml.etree.ElementTree as ET


mytree = ET.parse('NameFile.xml')
myroot = mytree.getroot()
print(myroot)

Tags: 文件代码import文件夹错误笔记本jupyterxml