0 votes
1 view
in RPA by (12.8k points)

Value check stays the same no matter what color does it get. It should give me RGB value of exact pixel every second

I tried doing it in recursion, simplified it, tested on multiple objects, result stays the same.

im = pg.screenshot()

import time

while True:

        check=im.getpixel((216, 169))

        time.sleep(1)

        print(check)

I expected the dynamically changing output depending on the color of pixel (216, 169). Currently I receive the same RGB value every second

1 Answer

0 votes
by (29.8k points)

you're taking the screenshot once and then re-checking it over and over

code given takes new screenshots every second.
below 

while True:
        im = pg.screenshot()
        check = im.getpixel((216, 169))
        time.sleep(1)
        print(check)

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...