On Feb.13 18h37, Thomas Girod wrote :
> Hi there.
> 
> I'm trying to get a list of attributes from a class. The dir() function
> seems to be convenient, but unfortunately it lists to much - i don't
> need the methods, neither the built-in variables.

If you do something like this you should have a list of attributes:

l = dir(object)
l = [s for s in l if s[:2] != '__']
l = [s for s in l if not callable(getattr(object, s))]

cheers,

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

Reply via email to