Created
March 28, 2018 16:41
-
-
Save estevaofon/9bb254f05d655571890a8b02682d19e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
data = {} | |
data['people'] = [] | |
data['people'].append({ | |
'name': 'Scott', | |
'website': 'stackabuse.com', | |
'from': 'Nebraska' | |
}) | |
data['people'].append({ | |
'name': 'Larry', | |
'website': 'google.com', | |
'from': 'Michigan' | |
}) | |
data['people'].append({ | |
'name': 'Tim', | |
'website': 'apple.com', | |
'from': 'Alabama' | |
}) | |
with open('data.txt', 'w') as outfile: | |
json.dump(data, outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment