class Data(object):
def __init__(self):
self.value1 = 'caixukun'
self.value2 = 'wuyifan'
self.value3 = 'mabaoguo'
if __name__ == '__main__':
# 随便声明一个类
data = Data()
# 打印它的全部属性
print('\n'.join(['{0}: {1}'.format(item[0], item[1]) for item in data.__dict__.items()]))
# value1: caixukun
# value2: wuyifan
# value3: mabaoguo