简体   繁体   English

如何使用xlrd或xlwt打开Excel应用程序?

[英]How do I open Excel Application using xlrd or xlwt?

我知道我可以通过将Visible设置为true来使用win32com打开MS Excel应用程序。我可以使用xlrd或xlwt这样做吗?

xlrd and xlwt are both libraries for reading Excel's files (that is, the storage format) - they have no connection to the actual Excel executable or libraries (they don't even require that Excel is installable on the system in question (I'm using them, for example on a CentOS machine). xlrd和xlwt都是用于读取Excel文件(即存储格式)的库-它们与实际的Excel可执行文件或库没有任何关系(它们甚至不需要在相关系统上安装Excel(我是使用它们,例如在CentOS机器上)。

If you simply want to lauch Excel you can use subprocess : 如果您只是想放弃Excel,可以使用subprocess

# Note, your path probably differs
subprocess.call(r"C:\Program Files\Microsoft Office\Office12\EXCEL.exe")

# The script will wait until Excel is closed and then continue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM