python 获取et和excel的版本号

yipeiwu_com6年前Python基础
复制代码 代码如下:

#-*- coding:utf-8 -*-
from win32com.client import Dispatch
if __name__ == '__main__':
app = Dispatch("et.Application")
# 小版本号
print 'app.Build:%s' % app.Build
# 大版本号
print 'app.Version:%s' % app.Version
app.Quit()

app = Dispatch("excel.Application")
# 小版本号
print 'app.Build:%s' % app.Build
# 大版本号
print 'app.Version:%s' % app.Version
app.Quit()

运行结果如下:
app.Build:6.4.0.1913
app.Version:6.0
app.Build:5612.0
app.Version:11.0

相关文章

selenium 多窗口切换的实现(windows)

在web应用中,常常会遇见点击某个链接会弹出一个新的窗口,或者是相互关联的web应用 ,这样要去操作新窗口中的元素,这时就需要主机切换到新窗口进行操作。。WebDriver 提供了swi...

Python List列表对象内置方法实例详解

本文实例讲述了Python List列表对象内置方法。分享给大家供大家参考,具体如下: 前言 在上一篇中介绍了Python的序列和String类型的内置方法,本篇继续学习作为序列类型成员...

Python3 使用map()批量的转换数据类型,如str转float的实现

我们知道map() 会根据提供的函数对指定序列做映射。 第一个参数 function 以参数序列中的每一个元素调用 function 函数,返回包含每次 function 函数返回值的新...

Python实现合并字典的方法

本文实例讲述了Python实现合并字典的方法。分享给大家供大家参考。具体实现方法如下: # 将两个字典合并 #!/usr/bin/python def adddict(dict1,d...

python实现海螺图片的方法示例

python实现海螺图片的方法示例

本文介绍了如何用python实现海螺图片,感兴趣的可以参考一下,具体代码如下: 代码如下: import turtle import time t = turtle.Turtl...