'bool' object not callable

Asked by Smythe Winsington

I have the simple script:

if find( ):
 popup("Case 1!")
 exit()
elif find( ):
 popup("Case 2!")
 exit()

and when I run it I get the follow error:

[sikuli] Stopped
[sikuli] An error occurs at line 1
[sikuli] Error message:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: 'bool' object is not callable

and I'm not really sure why...any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Smythe Winsington
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

1. if you want this script to run, you have to use exists() instead of find(), since if a find fails, the script will simply stop with a FindFailed. So you never will have a popup() "Case 2!".

2. I tried this script and did not have your problem. Something seems to be wrong with the file name of the first find.
Take care, that you either run the script from scratch (only a tab "untitled"), or check your .sikuli folder, that it contains only the needed pictures and a file myname.py, where myname should be the same as the name of the .sikuli.

Revision history for this message
Smythe Winsington (zrb0529) said :
#2

thanks! :)