同时使用pyautogui和pywinauto中Application方法报错,尝试各种办法无法解决,请高...
代码如下:import pyautogui
from pywinauto import Application
pyautogui.moveTo(50,50,duration=0.25)
报错信息:
Traceback (most recent call last):
File "D:/SVN/AutoTest/test.py", line 4, in <module>
pyautogui.moveTo(50,50,duration=0.25)
File "D:\Program Files\Python37\lib\site-packages\pyautogui\__init__.py", line 811, in moveTo
_failSafeCheck()
File "D:\Program Files\Python37\lib\site-packages\pyautogui\__init__.py", line 1240, in _failSafeCheck
if FAILSAFE and tuple(position()) in FAILSAFE_POINTS:
File "D:\Program Files\Python37\lib\site-packages\pyautogui\__init__.py", line 296, in position
posx, posy = platformModule._position()
File "D:\Program Files\Python37\lib\site-packages\pyautogui\_pyautogui_win.py", line 362, in _position
ctypes.windll.user32.GetCursorPos(ctypes.byref(cursor))
ctypes.ArgumentError: argument 1: <class 'TypeError'>: expected LP_POINT instance instead of pointer to POINT
备注:
如果单独使用pyautogui 正常,如下:
import pyautogui
pyautogui.moveTo(50,50,duration=0.25)
只要引入pywinauto的Application就报错
冲突了 不清楚 不太清楚 查一下报错信息 仔细看查看和自我分析原因,相信你应该没问题 兼容性或者程序、软件和环境等之间冲突
页:
[1]