python - How to tell if a variable is a string or a list, or etc in SIkuli? -
i check if variable string or list, or etc in sikuli? mean variables been used in idle.
usually in python, can use type(varname)
determine variable type. sikuli however, using type()
different purpose , hence method should used. there few options.
isinstance()
.matches.__class__
- just printing value. in many cases easy enough see type variable printing it. example, if variable printed
[]
- that's list,{}
- dictionary, etc...
example:
>>> lst1 = ['a', 'b', 'c'] >>> isinstance(lst1, list) true >>> lst1.__class__ <type 'list'>
Comments
Post a Comment