कई छवियों के लिए pyautogui.locateOnScreen ()?

Nov 27 2020

आप pyautogui.locateOnScreen()कई छवियों के लिए छवियों का एक गुच्छा कैसे करेंगे ?

जवाब

1 AndrewStone Nov 28 2020 at 19:00

इसे आज़माएं:

import os
import pyautogui as py


image_list = []

# Get list of all files in current directory
directory = os.listdir()

# Find files that end with .png or .jpg and add to image_list
for file in directory:
    if file.endswith('.png') or file.endswith('.jpg'):
        image_list.append(file)

# Loop through list to find all the images
for image in image_list:
    print(image)
    print(py.locateOnScreen(image))

यह सवाल एक और के समान है एक , मैं दोनों स्थानों पर एक ही उत्तर पोस्ट।