python json序列化问题
TypeError: Object of type ‘Decimal’ is not JSON serializable
import decimal
import json
class CJsonEncoder(json.JSONEncoder):
"""
json格式化问题,解决python不能序列化问题
"""
def default(self, obj):
if isinstance(obj, decimal.Decimal):
.
原创
2021-05-25 09:49:26 ·
328 阅读 ·
0 评论