Encoding nested python object in JSON

前端 未结 5 2027
说谎
说谎 2020-12-08 02:37

I want to encode objects in JSON. But, I can not figure out how to make the output without the string escaping.

import json

class Abc:
    def __init__(self         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 02:51

    This is what you're looking for: https://github.com/jsonpickle/jsonpickle

    It does nested serialization of Python objects and can easily be extended to serialize custom types.

提交回复
热议问题