Skip to content

Instantly share code, notes, and snippets.

@casprwang
Created December 7, 2016 00:17
Show Gist options
  • Save casprwang/9303caeac937e04dd5c54e5eb884211e to your computer and use it in GitHub Desktop.
Save casprwang/9303caeac937e04dd5c54e5eb884211e to your computer and use it in GitHub Desktop.
try:
with open('python4.json', 'a') as f:
tweet = json.loads(data)
geo_data = {
"features": []
}
if tweet['place']:
geo_json_feature = {
"place": tweet['place'],
}
geo_data['features'].append(geo_json_feature)
f.write(json.dumps(geo_data, indent=2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment