How to use functions with a default region
Hi,
I'm trying to create a function where the caller can optionally pass a region, if no region is passed the Screen region should be used as default, but this is not working. What am I doing wrong?
This is my function:
def tryClick(
if reg.exists(
return True
else:
return False
calling lines might be something like:
tryClick("img.png") #use Screen as region
tryClick(
tryClick(
I get an error like below when calling the function using the first line:
File "C:\Users\
if reg.exists(
TypeError: exists(): self arg can't be coerced to org.sikuli.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Michiel Vanthuyne for more information if necessary.