1、python下载地址
地址一:Python Windows版本下载| Python中文网 官网
地址二:Download Python | Python.org
地址三:32位和64位安装包
https://download.csdn.net/download/notfindjob/89569357
2、
方法1:使用comtypes
pip install comtypes
import comtypes.client
from ctypes import c_char_p
# 获取COM组件
com_object = comtypes.client.CreateObject("项目名.接口名.1") #ProgID
#com_object = comtypes.client.CreateObject("CLSID")
# 调用COM组件的方法
str = "a123"
c_string = c_char_p(str.encode()) #//使用.encode('GBK')将其转换为字节串
print(c_string)
result = com_object.GetName(str)
#print(str)
print(result)
方法2:
pip install pywin32
import win32com.client
# 初始化COM组件
com_object = win32com.client.Dispatch(""项目名.接口名.1"") #ProgID
# 使用COM组件的方法和属性
result = com_object.GetName()
print(result)