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

相关文章

用python求一重积分和二重积分的例子

首先是对一元函数求积分,使用Scipy下的integrate函数: from scipy import integrate def g(x): return (1-x**2)**...

Python标准库sched模块使用指南

事件调度 sched 模块内容很简单,只定义了一个类。它用来最为一个通用的事件调度模块。 class sched.scheduler(timefunc, delayfunc) 这个类定义...

解决matplotlib库show()方法不显示图片的问题

最近使用python里的matplotlib库绘图,想在代码结束时显示图片看看,结果图片一闪而过,附上我原来代码: import matplotlib.pyplot as plt i...

tensorflow 重置/清除计算图的实现

调用tf.reset_default_graph()重置计算图 当在搭建网络查看计算图时,如果重复运行程序会导致重定义报错。为了可以在同一个线程或者交互式环境中(ipython/jupy...

python实现猜数字游戏(无重复数字)示例分享

复制代码 代码如下:import time, random class GuessNum:    def __init__(self): &nbs...