>>> class Test():
... pass
...
>>> a = Test()
>>> a.blah = 5
>>> dir(a)
['__doc__', '__module__', 'blah']
>>> for x in dir(a):
... if "__" not in x:
... print eval("a." +str(x))
...
5
Saturday, May 22, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment