生成不了pdf,運(yùn)行也沒(méi)報(bào)錯(cuò)
import?os from?win32com.client?import?constants,gencache def?createpdf(wordPath,?pdfPath): ????word?=gencache.EnsureDispatch('Word.Application') ????doc?=?word.Documents.Open(wordPath,?ReadOnly=1) ????doc.ExportAsFixedFormat(pdfPath,?constants.wdExportFormatPDF) ????word.Quit() ????createpdf('D:/jw/study/python/writeexcel/info.docx','D:/jw/study/python/writeexcel/info.pdf')