Rominsky schrieb:
> I am trying to use dir to generate a list of methods, variables, etc.
> I would like to be able to go through the list and seperate the
> objects by type using the type() command, but the dir command returns
> a list of strings.  When I ask for the type of an element, the answer
> is always string.  How do I point at the variables themselves.  A
> quick example is:
> 
> a = 5
> b = 2.0
> c = 'c'
> 
> lst = dir()
> 
> for el in lst:
>     print type(el)

for name, obj in vars().iteritems():
    print name, obj

Christian

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to