def prn_obj(obj): print '\n'.join(['%s:%s' % item for item in obj.__dict__.items()]) 以上是打印某个对象的所有属性值的方法