I would like to check if variable is a string or a list, or etc in Sikuli? I mean variables that are currently been used in the IDLE.
Usually in Python, you can use type(varName)
to determine the variable type. Sikuli however, is using type()
for a different purpose and hence another method should be used. There are few options.
isinstance()
.matches.__class__
[]
- that's a list, {}
- dictionary, etc...Example:
>>> lst1 = ['a', 'b', 'c']
>>> isinstance(lst1, list)
True
>>> lst1.__class__
<type 'list'>