用Python读取docx文件
我找不到任何关于如何用Python读取docx文件的文档。有没有人能提供一个例子呢?
path = 'C:\'
fn = 'file.docx'
1 个回答
1
试试这个链接:
http://www.darkcoding.net/software/printing-word-and-pdf-files-from-python/
from win32com import client
import time
word = client.Dispatch("Word.Application")
def printWordDocument(filename):
word.Documents.Open(filename)
word.ActiveDocument.PrintOut()
time.sleep(2)
word.ActiveDocument.Close()
word.Quit()