📜  python获取字典的ppretty字符串表示 - Python代码示例

📅  最后修改于: 2022-03-11 14:47:06.548000             🧑  作者: Mango

代码示例1
from pprint import pformat

# Sufficiently large to make newline character in new format
d = {"a": {'b': [1, 2, 3]}, "c": [4, 5], 'd': {'e': {'f': [6, 7, 8]},
     'g': [9, 10]}, 'h': 11, 'i': 12}
pformat(d)