#Python 2 for attr, value in k.__dict__.iteritems(): print attr, value #Python 3 for attr, value in k.__dict__.items(): print(attr, value)