def prn_obj(obj): print '\n'.join(['%s:%s' % item for item in obj.__dict__.items()]) 转载于:https://www.cnblogs.com/Niuxingyu/p/11232652.html