← Back to team overview

sikuli-driver team mailing list archive

[Question #180618]: [HowTo] Passing extra arguments to event handler

 

New question #180618 on Sikuli:
https://answers.launchpad.net/sikuli/+question/180618

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()

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.