Skip to main content
 首页 » 编程设计

python之如何在 python 中安装 xml.dom.minidom

2024年11月01日11powertoolsteam

我想安装 minidom 但我不知道如何安装。它是 PyXML 的一部分吗?

我已经尝试使用 PyXML 的简易安装,但它似乎不起作用。

请您参考如下方法:

啊,你不需要 PyXML 来使用它,它包含在标准库中。

>>> import xml.dom.minidom 
>>> help(xml.dom.minidom) 
 
Help on module xml.dom.minidom in xml.dom: 
 
NAME 
    xml.dom.minidom - Simple implementation of the Level 1 DOM. 
 
DESCRIPTION 
    Namespaces and other minor Level 2 features are also supported. 
 
    parse("foo.xml") 
 
    parseString("<foo><bar/></foo>") 
 
    Todo: 
    ===== 
     * convenience methods for getting elements and text. 
     * more testing 
     * bring some of the writer and linearizer code into conformance with this 
            interface 
     * SAX 2 namespaces 
... 
... 

希望这对您有所帮助!