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