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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -