python store json

Solutions on MaxInterview for python store json by the best coders in the world

showing results for - "python store json"
Clayton
28 Jul 2017
1import json
2
3data = {}
4data['people'] = []
5data['people'].append({
6    'name': 'Scott',
7    'website': 'stackabuse.com',
8    'from': 'Nebraska'
9})
10data['people'].append({
11    'name': 'Larry',
12    'website': 'google.com',
13    'from': 'Michigan'
14})
15
16with open('data.txt', 'w') as outfile:
17    json.dump(data, outfile)
18