【问题标题】:windll.gdi32.GetPixel failed with pyautogui and Variables from configparserwindll.gdi32.GetPixel 因 pyautogui 和来自 configparser 的变量而失败
【发布时间】:2023-01-09 21:27:27
【问题描述】:

我试图用 configpaser 做一个 config.ini 我让它工作了

from configparser import ConfigParser

#-------Message Config Start ------------#
config =  ConfigParser()
config.read('config.ini')

#Devicename for Message Curls 
Geraet = str = config['DEFAULT']['Geraet_Name']
YellowBellX = str = config['DEFAULT']['YellowBellXCoord']
YellowBellY = str = config['DEFAULT']['YellowBellYCoord']

它适用于电报卷曲的网址,Geraet Name 也适用

但是当我将它用于 x y 进行像素匹配时,我得到了错误 异常 windll.gdi32.GetPixel 失败:返回 -1

如果我将 YellowBellX 更改为 Coords,它就可以工作 黄铃X = 355 黄铃Y = 219

这有效,像素匹配正确无误

但我想在配置文件中使用变量

【问题讨论】:

    标签: pywin32 pyautogui pixelmatch


    【解决方案1】:

    【讨论】:

    猜你喜欢
    • 2014-04-03
    • 1970-01-01
    • 2018-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-20
    • 2018-04-02
    相关资源
    最近更新 更多