• 周一. 5月 27th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

PyAutoGui[winerror2]在使用Pyins将脚本转换为exe之后

[db:作者]

3月 7, 2023

我只是想请你帮我解决下面的问题。
我的代码运行得很好,但是在使用PyInstaller将其转换为.exe之后,我将遇到{}。在

请告诉我怎样才能修好它。在

FileNotFound:[WinError 2]

代码:

import pyautogui, time

try:
    while True:
        time.sleep(30)
        pyautogui.dragRel(1,0)
        pyautogui.dragRel(-1,0)

except keyboardInterrupt:
    print('Done')

Tags:

代码importtruetimesleepexeprinttrypyinstallerexceptwhile代码运行pyautoguikeyboardinterruptdragrel1条回答网友

1楼 ·

发布于 2023-03-07 00:10:53

我对PyAutoGUI和PyInstaller也有同样的问题,无法通过点击来工作。不过,移动鼠标和图像识别似乎可以工作。在

多亏了这篇文章,here我找到了一个“变通办法”:

而不是使用pyautogoi.click()方法,我使用的是来自ctypes的类似方法。在

import ctypes

我交换了pyautogui.click()与

^{pr2}$

对于双击,我只调用这两个方法两次。在

《PyAutoGui[winerror2]在使用Pyins将脚本转换为exe之后》有9个想法
  1. Wow amazing blog layout How long have you been blogging for you made blogging look easy The overall look of your web site is magnificent as well as the content

  2. Wonderful web site Lots of useful info here Im sending it to a few friends ans additionally sharing in delicious And obviously thanks to your effort

  3. of course like your website but you have to check the spelling on several of your posts A number of them are rife with spelling issues and I in finding it very troublesome to inform the reality on the other hand I will certainly come back again

  4. Appreciating the commitment you put into your blog and detailed information you provide.
    It’s great to come across a blog every once in a while that isn’t the same out of
    date rehashed material. Excellent read! I’ve bookmarked your site and I’m adding your RSS feeds
    to my Google account. I saw similar here: Dobry sklep

  5. Howdy! Do you know if they make any plugins to help
    with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m
    not seeing very good success. If you know of any
    please share. Kudos! You can read similar text here: Sklep online

  6. Wow, superb weblog layout! How lengthy have you been running a blog for?

    you made running a blog look easy. The overall look of your
    web site is magnificent, let alone the content
    material! You can see similar here ecommerce

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注