Python 3.4 :ImportError: no module named win32api

前端 未结 6 1384
萌比男神i
萌比男神i 2020-11-28 11:26

I am using python 3.4 on windows 7.In order to open a doc file i am using this code

import sys
import win32com.client as win32

word = win32.Dispatch(\"Word.         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 12:09

    You can create the __init.py file inside the win32 folder and then go inside the win32com folder and change its __init__.py file, where it is import win32api, change to from win32 import win32api

提交回复
热议问题