在Python中读取/写入MS Word文件 [英] Reading/Writing MS Word files in Python
本文介绍了在Python中读取/写入MS Word文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在不使用COM对象的情况下用Python读取和写入Word(2003和2007)文件?
我知道我可以做到:
Is it possible to read and write Word (2003 and 2007) files in Python without using a COM object?
I know that I can:
f = open('c:\file.doc', "w")
f.write(text)
f.close()
但是Word会将其读取为HTML文件而不是本机.doc文件.
but Word will read it as an HTML file not a native .doc file.
推荐答案
我会研究 IronPython 可以访问Windows/Office API,因为它可以在.NET运行时上运行.
I'd look into IronPython which intrinsically has access to windows/office APIs because it runs on .NET runtime.
这篇关于在Python中读取/写入MS Word文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文