《Python绝技:运用Python成为顶级黑客》
【解决】真是不明白,我在部分win7电脑直接pip install pywinauto 就可以。但是又有几部电脑安装pywinauto后,import pywinauto 就是有下面的错误。
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
Traceback (most recent call last):
File "D:\Python38-32\lib\ctypes\__init__.py", line 123, in WINFUNCTYPE
return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'ctypes.c_long'>, <class 'comtypes.automation.tagVARIANT'>, <class 'ctypes.c_long'>, <class 'comtypes.LP_POINTER(IUIAutomationTextRange)'>), 0)
During handling of the above exception, another exception occurred:
原来是python版本太高了,现在pywinauto只支持 3.7.4以下。