Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用写字板(不是 MS word)打开 word 文件?我可以使用 win32com.client 使用 MS 字打开 doc 文件,如下所示:
word = win32.gencache.EnsureDispatch('Word.Application') word.Visible = True
不知道如何使用写字板做到这一点。有没有办法做到这一点?
好的,我可以使用子进程来完成这项工作:
import subprocess as sp sp.Popen([programName, fileName])
pf = os.getenv("ProgramFiles") subprocess.call([pf + "\\Windows NT\\Accessories\\wordpad.exe",filename])