学林漫录:美化数据输出——pprint Posted on 2019-06-25 | Edited on 2019-07-16 | In python | Comments: 美化数据输出的一个包,对我来说最大的用处就是控制 depth 12data = [(1,{'a':'A','b':'B','c':'C','d':'D'}), (2,{'e':'E','f':'F','g':'G','h':'H','i':'I','j':'J','k':'K','l':'L'})] 1234import pprintpprint.pprint(data)pprint.pprint(data, depth = 2) Related Posts Numpy Note 1 Numpy Note 2 Python cheatsheet Python decorators Python import 小结