TypeError when converting dictionary to JSON array

前端 未结 1 1679
花落未央
花落未央 2021-02-02 09:41

How do I take a python dictionary where the keys and values are Strings and convert it into a JSON String.

This is what I have right now:

import json

de         


        
1条回答
  •  無奈伤痛
    2021-02-02 09:41

    You are trying to serialise the type object, dict, instead of info. Dump the right variable:

    print(json.dumps(info))
    

    0 讨论(0)
提交回复
热议问题