[HowTo] Passing extra arguments to observe's onXXX event handlers
Asked by
Mikeldi Latorre
Just wanted to share this:
If you need to pass some extra argument apart from the event, you can do it like this:
x="extra argument"
onAppear(img, lambda event, arg=x: handler(event, arg))
observe(timeout)
def handler(event, arg):
print(arg)
stopObserver()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Mikeldi Latorre
- Solved:
- Last query:
- Last reply:
To post a message you must log in.