這樣就會附帶安裝pythoncom了
#2018年更新,這個問題在 comtypes 1.1.4 版中已經被修正了
使用comtypes 有時候會出現
將 comtypes 裡的 __init__. py 第 658 行程式碼做些修改可以修正這個bug
路徑大概類似這樣
~python\Lib\site-packages\comtypes\__init__ 657 # be iterable .
658 if len ( outargs ) == 1: # rescode is not iterable
--> 659 return resc o de. __ctypes_from_outparam __( )
660
661 resc ode = li st( resc ode)
改成
# be itera ble .
if len(outargs) == 1: # rescode is not iterable
try:
return rescode.__ctypes_from_outparam__()
except: #somtimes rescode is tuple
return rescode
rescode = list(rescode)
即可修正
Ref:
沒有留言:
張貼留言