“If you can't explain it to a six year old, you don't understand it yourself.” ― Albert Einstein
import json jsonData = ['foo', {'bar': ('baz', None, 1.0, 2)}] with open('sample.json', 'w') as outfile: json.dump(jsonData, outfile, sort_keys= True, indent=4)
No comments:
Post a Comment