Language/Python

Python - PyInspect 설치 및 실행

TechNote.kr 2020. 2. 28. 20:15
728x90

 

1) https://github.com/pywinauto/py_inspect 에 접속하여 code 다운로드

 

 

 

2) python 3.5 이상, pywinauto, PyQt5 설치

 

 

3) "python py_inspect.py" 으로 실행

 

 

 

 

특이사항

 

1) 실행시 2회 실패 후 3회시 부터 정상 실행됨.

 

1회 실패시 에러 내용

D:\workspace\py_inspect-master>python py_inspect.py
QWindowsContext: OleInitialize() failed:  "COM error 0xffffffff80010106 RPC_E_CHANGED_MODE (Unknown error 0x080010106)"
Traceback (most recent call last):
  File "py_inspect.py", line 147, in <module>
    main()
  File "py_inspect.py", line 12, in main
    w = MyWindow()
  File "py_inspect.py", line 41, in __init__
    self.__initialize_calc()
  File "py_inspect.py", line 50, in __initialize_calc
    self.tree_model = MyTreeModel(self.element_info, _backend)
  File "py_inspect.py", line 77, in __init__
    self.__get_next(element_info, self.branch)
  File "py_inspect.py", line 81, in __get_next
    self.__generate_props_dict(child)
  File "py_inspect.py", line 96, in __generate_props_dict
    ['enabled', str(element_info.enabled)],
  File "D:\Python\382_64\lib\site-packages\pywinauto\uia_element_info.py", line 321, in enabled
    return bool(self._element.CurrentIsEnabled)
_ctypes.COMError: (-2147024891, '액세스가 거부되었습니다.', (None, None, None, 0, None))

 

2회 실패시 에러 내용

D:\workspace\py_inspect-master>python py_inspect.py
QWindowsContext: OleInitialize() failed:  "COM error 0xffffffff80010106 RPC_E_CHANGED_MODE (Unknown error 0x080010106)"
Traceback (most recent call last):
  File "py_inspect.py", line 147, in <module>
    main()
  File "py_inspect.py", line 12, in main
    w = MyWindow()
  File "py_inspect.py", line 41, in __init__
    self.__initialize_calc()
  File "py_inspect.py", line 50, in __initialize_calc
    self.tree_model = MyTreeModel(self.element_info, _backend)
  File "py_inspect.py", line 77, in __init__
    self.__get_next(element_info, self.branch)
  File "py_inspect.py", line 81, in __get_next
    self.__generate_props_dict(child)
  File "py_inspect.py", line 100, in __generate_props_dict
    ['rectangle', str(element_info.rectangle)],
  File "D:\Python\382_64\lib\site-packages\pywinauto\uia_element_info.py", line 326, in rectangle
    bound_rect = self._element.CurrentBoundingRectangle
_ctypes.COMError: (-2147220991, '이벤트에서 가입자를 불러낼 수 없습니다.', (None, None, None, 0, None))

 

 

2) Microsoft Inspect 와 달리 표시 내용이 제한적임

 

Microsoft Inspect : https://technote.kr/348oft Inspe

 

 

 

 

728x90