I'm relatively new to Python still, so feel free to let me know if there's something basic I'm missing.
In the interest of easy debugging, I've gotten in the habit of creating a show() procedure for every object I create. For example:
class YourMom:
def __init__(self):
self.name = ""
self.age = ""
self.children = []
#End init()
def show(self):
print "Name is '%s'" % (self.name)
print "Age is '%s'" % (self.age)
for i in self.children:
print " Children: '%s'" % (i)
#End show()
#End YourMom class
So my question is simple: Is there a programmatic way to do a show() procedure without needing to write it manually each time?
Edit: There is a similar question here: List attributes of an object But I'm looking for the VALUES in the object properties as well as the list of them.