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利用flask sqlalchemy实现分页效果

Python利用flask sqlalchemy实现分页效果

Flask-sqlalchemy是关于flask一个针对数据库管理的。文中我们采用一个关于员工显示例子。 首先,我们创建SQLALCHEMY对像db。 from flask impo...

Python中index()和seek()的用法(详解)

1、index() 一般用处是在序列中检索参数并返回第一次出现的索引,没找到就会报错,比如: >>> t=tuple('Allen') >>> t...

django将图片上传数据库后在前端显式的方法

1、使用ImageField先安装pillow模块 pip install pillow 2、在app的models中设置 class Image(models.Model):...

python3.7 openpyxl 删除指定一列或者一行的代码

python3.7 openpyxl 删除指定一列或者一行 # encoding:utf-8 import pandas as pd import openpyxl xl = pd....

python多任务之协程的使用详解

1|0使用yield完成多任务 import time def test1(): while True: print("--1--") time.sleep(0.5)...