Source Code:
(back to article)
import json data = { "name": "John Smith", "age": 30, "city": "New York" } json_data = json.dumps(data) with open("data.json", "w") as outfile: outfile.write(json_data)
Result:
Report an issue