IronPython : show attributs/values of an object

/ Published in: Python
Save to your folder(s)

Copy this code and paste it in your HTML
  1. def show(obj):
  2. if obj!=None:
  3. for i in dir(obj):
  4. v=getattr(obj,i)
  5. if "builtin_function_or_method" not in str(type(v)) and not i.startswith("__"):
  6. print "%s.%s (%s)= %s" % (obj.__class__.__name__,i,type(v), v)
  7. else:
  8. print "SHOW NONE !!!"

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.