Python × lxml.etree:從 Word OOXML 讀、查、改、寫的實戰筆記; from lxml import etree ; parser = etree.XMLParser() ; root = etree.fromstring(xml.encode(“utf-8″), parser=parser) #(根節點); print(etree.tostring(root, encoding=”unicode”, pretty_print=True)) #encoding=”unicode”輸出str ; “utf-8″輸出bytes,漂亮顯示
sample.docx 內容(1021 KB): 將附檔名改為.zi...

近期留言