Sikuli - Python : Compare text from two different applications

Asked by Jp17 on 2017-07-08

Hi,

I have tried the following code to verify values in two different applications but it does not seem to work and the message log is only printing 'Value does not match'. Just to mention I have switched on the tesseract OCR. Could you kindly point out where am I doing it wrong? Thanks

In my excel file column A I have list of values like:
1
2
3
4

In my Sikuli file I want to check every value in column A and if there is match then print message accordingly:

var = sheet.col_values(3) #this part is working I have tried with print var

var1 = Region() # this is in the other application
var2 = var1.text() # the value here is 1

i = 0
for rows in sheet.col(3):
 if var2 == var[i]:
    print 'Value match'
 else:
    print 'Value does not match'

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Jp17
Solved:
2017-07-10
Last query:
2017-07-10
Last reply:
2017-07-09
masuo (masuo-ohara) said : #1

You have to do SikuliX setting to activate OCR feature.

open SikulixIDE

type Ctrl + p to open setting window

click [more options...] button

check [allow OCR] check box

click [Save] button

Jp17 (jlin17) said : #2

I have done that already and that part is working.

Jp17 (jlin17) said : #3

I have read this post and seem to provide me a solution: https://answers.launchpad.net/sikuli/+question/139475