No float variable in similar()?

Asked by Jason

Hi,

I'm trying to change the similar() value using a float variable.
I tried this:

from decimal import *
floatValue=0.8
y=Pattern(image).similar(Decimal(str(floatValue)))
click(y)

What am I doing wrong?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Jason (jasonyoo) said :
#1

I get this error:
TypeError: similar(): 1st arg can't be coerced to float

Revision history for this message
Best RaiMan (raimund-hocke) said :
#2

why not only:
floatValue = 0.8
y=Pattern(image).similar(floatValue)

or just
y=Pattern(image).similar(0.8)

Revision history for this message
Jason (jasonyoo) said :
#3

Thanks RaiMan, that solved my question.