python clsid_Python win32com不知道模块名称

在尝试寻找Zune的Python API时,作者发现可以使用win32com来与COM对象交互。通过makepy生成的文件,作者找到了CLSID,但不确定如何在win32com.client.gencache.EnsureDispatch中使用。解决方案是检查生成的Python文件中的注释,以找到CoClass的名称,从而正确调用COM对象。
摘要由CSDN通过智能技术生成

I was looking for a python Zune(The windows media thing) api, when I looked at the COM browser in pythonwin. I found something called ZuneWmdu Type Library (1.0).

I used makepy on that lib, it generated a file

9FE20C05-81CE-46D7-9C56-FD97A865BBB8x0x1x0.py

in

python 2.7.3\Lib\site-packages\win32com\gen_py

I have no idea what to pass into

win32com.client.gencache.EnsureDispatch('???')

I tried calling

win32com.client.gencache.EnsureDispatch('9FE20C0581CE46D79C56FD97A865BBB8')

Resulting in an exception (pywintypes.com_error)

(The x0x1x0 part of the .py file seemed unrelated)

I tried the same with

win32com.client.gencache.GetModuleForCLSID('9FE20C05-81CE-46D7-9C56-FD97A865BBB8')

and

win32com.client.gencache.GetModuleForProgID('9FE20C0581CE46D79C56FD97A865BBB8&

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值