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.

  1. isinstance().
  2. matches.__class__
  3. 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

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -