Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 454 Bytes

201.md

File metadata and controls

25 lines (19 loc) · 454 Bytes
@author jackzhenguo
@desc 格式化json串
@tag
@version 
@date 2020/04/08
import json


def format_json(json_str: str):
    dic = json.loads(json_str)

    js = json.dumps(dic,
                    sort_keys=True,
                    ensure_ascii=False,
                    indent=4,
                    separators=(', ', ': '))
    return js
[上一个例子](200.md) [下一个例子](202.md)