把 Python 转换为 JSON把 Python 转换为 JSONimport json # a Python object (dict):x = { "name": "Bill", "age": 63, "city": "Seatle"} # convert into JSON:y = json.dumps(x) # the result is a JSON string:print(y)