如何才能只获得数字输出
pyautogui.locateOnScreen('Capture.png')
如果pyautogui在屏幕上找不到图片,您将得到输出;None或如果pyautogui在屏幕上找到图片,它将输出如下: Box(left=1416,top=562,width=50,height=41)
有没有可能只从输出中提取数字?
发布于 2020-08-31 10:23:15
参考pyautogui的document,您可以使用:
location = pyautogui.locateOnScreen('Capture.png')
if location != None:
x, y, w, h = location或者:
if location != None:
x, y, w, h = location.left, location.top, location.width, location.heighthttps://stackoverflow.com/questions/63663875
复制相似问题