Question #264958 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/264958
Status: Open => Answered
RaiMan proposed the following answer:
I am really sorry: much buzz about nothing - but that is really my
fault:
this works for sorting matches:
sortedMatches = sorted(matches, key = lambda m: (m.y, m.x))
the sort function specified with key= might return a list of values, that are
used, to define the sort order:
- a match with a lower y value comes before any match with a higher value
- matches with same y are sorted according to their x value.
for more complex sorting, one can use this:
def order(match):
y = match.y
x = match.x
# do some calculation or whatever for y and x
return y, x
sortedMatches = sorted(matches, key = order) # the helper function is
called for each element in matches
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.
_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help : https://help.launchpad.net/ListHelp