HOME/Articles/

mysql example scorpio common util jsonFormat (snippet)

Article Outline

Python mysql example 'scorpio common util jsonFormat'

Functions in program:

  • def json_format(data):

Modules used in program:

  • import json

python scorpio common util jsonFormat

Python mysql example: scorpio common util jsonFormat

import json


def json_format(data):
    return json.dumps(data, sort_keys=True, indent=4, ensure_ascii=False)