我只是想问你的帮助下面我的问题。 我的代码工作完美,但使用PyInstaller
将其转换为.exe
后,我会遇到FileNotFoundError: [WinError 2]
。
请build议我如何解决它。
码:
import pyautogui, time try: while True: time.sleep(30) pyautogui.dragRel(1,0) pyautogui.dragRel(-1,0) except KeyboardInterrupt: print('Done')
我有与PyAutoGUI和PyInstaller相同的问题,无法获得点击工作。 移动鼠标和图像识别似乎工作。
感谢这篇文章,我发现了一个“解决方法”:
而不是使用pyautogoi.click()方法,我使用了一个类似ctypes的方法。
import ctypes
我与pyautogui.click()调用交换
# see http://msdn.microsoft.com/en-us/library/ms646260(VS.85).aspx for details ctypes.windll.user32.mouse_event(2, 0, 0, 0,0) # left down ctypes.windll.user32.mouse_event(4, 0, 0, 0,0) # left up
双击我只是调用这两个方法两次。