sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #36426
Re: [Question #280949]: Recognizing bad returns from Region.text()
Question #280949 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/280949
Status: Open => Answered
RaiMan proposed the following answer:
the easiest:
str = myRegion.text()
try:
myNum = float(str)
except:
myNum = 0 # or some other not possible value or
if myNum == 0:
# do some error handling
myNum = myNum + 5.0
print myNum
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.