GoodProgrammerPython学习路线分享Beeprint的使用方法,beeprint:让你的调试打印更友好推荐一个中文开源项目beeprint,可以更漂亮的打印你的调试信息。针对Python标准库的pprint进行基准测试。下面我们看一下beeprint和pprint打印Python对象的对比。打印字典对象pprint{'entities':{'hashtags':[],'urls':[{'display_url':'tumblr.com/xnr37hf0yz','expanded_url':'http://tumblr.com/xnr37hf0yz','indices':[107,126],'url':'http://t.co/cCIWIwg'}],'user_mentions':[]}}beeprint{'entities':{'hashtags':[],'urls':[{'display_url':'tumblr.com/xnr37hf0yz','expanded_url':'http://tumblr.com/xnr37hf0yz','indices':[107,126],'url':'http://t.co/cCIWIwg',},],'user_mentions':[],},}打印类对象pprintbeeprintclass(NormalClassNewStyle):dicts:{},lists:[],static_props:1,tupl:(1,2)打印实例(instance)pprintbeeprintinstance(NormalClassNewStyle):dicts:{},lists:[],say_hi:'helloworld',static_props:1,tupl:(1,2)打印长文本pprint[['\nsky和地球起初是一个像鸡蛋一样模糊的实体。盘古诞生于其中。\n\n\t天地分离一万八千年——轻而纯净的阳上升为天,\而阴沉浑浊\xef\xbc\x88\xe6\x9c\xa6\xe8\x83\xa7\xe7\x9a\x84\xef\xbc\x89沉没形成地球。其间有盘古,日九变,智慧大过天,能大过地。每天天高十尺,地厚十尺,盘古长高十尺。\n\n又是一万八千年过去了,天高了,地厚了,盘古高了.盘古死后,头化为五圣山(泰山、恒山、华山、恒山、嵩山),双眼化为日月,血化为江海之水,9\x95\xbf\xe9\xab\x98\xe4\xb8\x80\xe5\xb0\xba\xef\xbc\x8c\xe5\xa4\xa9\xe7\xa9\xba\xe5\xb0\xb1\xe9\x9a\x8f\xe4\xb9\x8b\xe5\xa2\x9e\xe9\xab\x98\xe4\xb8\x80\xe5\xb0\xba\xef\xbc\x8c\n\t\xe7\xbb\x8f\xe8\xbf\x871.8\xe4\xb8\x87\xe5\xa4\x9a\xe5\xb9\xb4\xe7\x9a\x84\xe5\x8a\xaa\xe5\x8a\x9b\xef\xbc\x8c\xe7\x9b\x98\xe5\x8f\xa4\xe5\x8f\x98\xe6\x88\x90\xe4\xb8\x80\xe4\xbd\x8d\xe9\xa1\xb6\xe5\xa4\xa9\xe7\xab\x8b\xe5\x9c\xb0\xe7\x9a\x84\xe5\xb7\xa8\xe4\xba\xba\xef\xbc\x8c\xe8\x80\x8c\xe5\xa4\xa9\xe7\xa9\xba\xe4\xb9\x9f\xe5\x8d\x87\xe5\xbe\x97\xe9\xab\x98\xe4\xb8\x8d\xe5\x8f\xaf\xe5\x8f\x8a\xef\xbc\x8c\xe5\xa4\xa7\xe5\x9c\xb0\xe4\xb9\x9f\xe5\x8f\x98\xe5\xbe\x97\xe5\x8e\x9a\xe5\xae\x9e\xe6\x97\xa0\xe6\xaf\x94\xe3\x80\x82\xe7\x9b\x98\xe5\x8f\xa4\xe7\x94\x9f\xe5\x89\x8d\xe5\xae\x8c\xe6\x88\x90\xe5\xbc\x80\xe5\xa4\xa9\xe8\xbe\x9f\xe5\x9c\xb0\xe7\x9a\x84\xe4\xbc\x9f\xe5\xa4\xa7\xe4\xb8\x9a\xe7\xbb\xa9\xef\xbc\x8c\xe6\xad\xbb\xe5\x90\x8e\xe6\xb0\xb8\xe8\xbf\x9c\xe7\x95