Saving dictionary whose keys are tuples with json, python

前端 未结 4 2545
醉话见心
醉话见心 2021-02-20 10:37

I am writing a little program in python and I am using a dictionary whose (like the title says) keys and values are tuples. I am trying to use json as follows

im         


        
4条回答
  •  生来不讨喜
    2021-02-20 11:09

    You can use ujson module. ujson.dumps() accepts tuples as keys in a dictionary. You can install ujson by pip.

提交回复
热议问题