一、打开word文档
def openWord(): """ 自动打开当前路径下的 “操作教程.doc” 文档 :return: """ from win32com import client as wc wordPath = os.path.join(os.getcwd(), '操作教程.doc') word = wc.Dispatch('Word.Application') word.Visible = 1 # 0-后台运行 1-前台运行(可见) word.DisplayAlerts = 0 # 不显示,不警告 doc = word.Documents.Open(wordPath)