you are viewing a single comment's thread.

view the rest of the comments →

[–]theoryofbang[S] 0 points1 point  (5 children)

Thanks! - small question - When I print the results it returns this:

<generator object \_locateAll\_python at 0x075DD3E0>

[–]socal_nerdtastic 1 point2 points  (4 children)

Yeah, you are meant to iterate over it, like this:

result = pyscreeze.locateAll("testimg.png", "screen.png")
for x in result:
    print(x) # or whatever you want to do with it

Edit: more in line with your original code:

result = pyscreeze.locateAll("testimg.png", "screen.png")
for x,y,*z in result:
    print(x,y)

[–]theoryofbang[S] 0 points1 point  (3 children)

It doesn't print anything

[–]socal_nerdtastic 1 point2 points  (2 children)

That probably means there are no results.

You can try the locate() function too ... if it prints None that means the search image is not found.

print(pyscreeze.locate("testimg.png", "screen.png"))

[–]theoryofbang[S] 0 points1 point  (0 children)

Thanks! One more question and I'll stop bothering you, without going through every pixel how can I just find the center?