sds*_*sds 5 python json pretty-print python-2.7
JSON的写法是indent=None(默认)作为单行(人眼无法读取),或者ident=N在每个逗号后都使用换行符。
我希望看到的是更紧凑但仍然很漂亮的输出,类似于Common Lisp漂亮的打印效果。例如,代替
{
"cleanup":{
"cpu":6936.780000000001,
"wall":7822.319401979446
},
"finished":"2017-08-14 18:36:23",
"init":{
"cpu":1365.73,
"wall":1380.7802910804749
},
"job":"timings",
"run":{
"cpu":953.6700000000001,
"wall":8350.496850013733
},
"started":"2017-08-14 13:28:06"
}
Run Code Online (Sandbox Code Playgroud)
我想看看
{
"cleanup":{"cpu":6936.780000000001,"wall":7822.319401979446},
"finished":"2017-08-14 18:36:23",
"init":{"cpu":1365.73,"wall":1380.7802910804749},
"job":"timings",
"run":{"cpu":953.6700000000001,"wall":8350.496850013733},
"started":"2017-08-14 13:28:06"
}
Run Code Online (Sandbox Code Playgroud)
类似于pprint产生的东西。
| 归档时间: |
|
| 查看次数: |
683 次 |
| 最近记录: |