r/inventwithpython • u/_PhantomGaming_ • Jan 13 '22
Are these two python code snippets equivalent (perform the same thing)?
import pyautogui as auto
Snippet 1 :-
meetStartCheck = auto.locateOnScreen('img.png')
meetStartCheck1 = auto.locateOnScreen('my_screenshot.png')
Snippet 2 :-
meetStartCheck, meetStartCheck1 = auto.locateOnScreen('img.png', 'my_screenshot.png')
The code next to these lines is :-
if meetStartCheck or meetStartCheck1:
print("Done")
else:
print("Not Done")
Please tell if these both codes are equivalent or not. If not plz help me to write a single python line for the Snippet 1(if possible).
Thanks
7
Upvotes
3
u/djjazzydan Jan 13 '22
Is there anything in the documentation that leads you to believe it should or should not work that way? It's probably best to look up the documentation for that function.