Skip to content

Instantly share code, notes, and snippets.

@estevaofon
Created March 28, 2018 16:41
Show Gist options
  • Save estevaofon/9bb254f05d655571890a8b02682d19e0 to your computer and use it in GitHub Desktop.
Save estevaofon/9bb254f05d655571890a8b02682d19e0 to your computer and use it in GitHub Desktop.
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