經安全檢測,此網站為安全網站,請放心前往原始網址!

Python – convert dictionary to json | Sany's Linux and Open Source Blog

To convert any dictionary to json use json.dumps(YourDictionary). Below is an example to convert a dictionary to json: import json def toJson(): d = {'a' : 'Apple', 'b' : 2} return json.dumps(d) print toJson() Output: {"a": "Apple", "b": 2}

viewsby.wordpress.com

網址安全性掃描由 google 提供