← Back to team overview

sikuli-driver team mailing list archive

[Question #680194]: OCR number reading works but how to put in conditions?

 

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

So I am really happy my script works and is reading numbers perfectly. I tested this with "print region.text()". But now I want that if he reads a "1" that he does action 1. I tried the following code but I get the following error:

[error] script [ test_OCR ] stopped with error in line 6 at column 10
[error] SyntaxError ( "mismatched input '=' expecting COLON", )

code:
======================
tr = TextOCR.start()
tr.setPSM(6)
r = Region(Region(1056,315,26,26))

if r.text() = "1":  
        print "action 1"
else:
        print "nothing" 
=====================

Cheers!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.