elementtree

    0热度

    1回答

    当我尝试运行此代码时,我收到了以前从未收到的错误。 File "BasicEmail.py", line 96, in init_ui root[0][1].text IndexError: child index out of range Abort trap: 6 我的代码很简单, class EmailBlast(QtWidgets.QWidget): def __init__(s

    0热度

    1回答

    我有一个xml标记,我在python中使用下面的代码来读取此标记,但我只想在type =“Actual”时才会获取数据,否则将忽略。目前我得到他们每个人的价值即40,50,60。 XML标签: <student type="Actual">40</student> <student type="estimated">50</student> <student>60</student> Py

    0热度

    1回答

    我要搜索一个特定的元素<B>如果<B>的孩子<C>等于s1我想从这个元素上搜索到下一个元素<X>字符串元素不是<B>的子女并返回其值(s2)。 树会是这个样子: <A> <B> <C>s1</C> </B> <D> <X>s2</X> </D> </A>

    0热度

    1回答

    的元素值,我需要在Python文件中像这样来改变一个子元素值: <stock> <product code="002"> <title>Electric</title> <tracks>Wild flower,Peace dog,Electric ocean</tracks> <price>30.50</price> <pictures>002.g

    1热度

    2回答

    我有这种结构的XML文件: <?DOMParser ?> <logbook:LogBook xmlns:logbook="http://www/logbook/1.0" version="1.2"> <product> <serialNumber value="764000606"/> </product> <visits> <visit> <general>

    0热度

    1回答

    特定项目 我提出到Salesforce的请求合并API和得到这样的回应: xml_result = '<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforc

    1热度

    2回答

    我试图将Oracle 12c数据库中保存的表导出为组成XML文件,以便Oracle表中的每一行生成1个XML文件。为此,我正在使用Python 2.7库xml.etree.ElementTree,但我在documentation中看不到任何可以让我这样做的任何内容。基本上我需要在这一点上是: import cx_Oracle from xml.etree import ElementTree a

    0热度

    2回答

    我想读 <dc:title> </dc:title> 之间的条目这是XML: <?xml version='1.0' encoding='utf-8'?> <package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="calibre-uuid"> <metadata xmlns:xsi="htt

    0热度

    1回答

    使用ElementTree的我有python脚本,我已经写了使用xml.etree.cElementTree编写XML文件的逻辑和逻辑看起来像下面 import xml.etree.cElementTree as ET root = ET.Element("root") for I in range(0,10): ET.SubElement(root, "field1").text

    2热度

    3回答

    我有Python脚本来将XML文件解析为另一个平台更友好的格式。 每隔一段时间,其中一个数据文件不包含任何数据 - 只有编码信息和其他标记,这会导致ElementTree在找到它们时抛出ParseError。 <?xml version="1.0" encoding="utf-8"?> 有没有在调用ElementTree之前测试空文件的方法? Ta。