Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Commit

Permalink
load multiple JSON objects from one file
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-wittmer committed Apr 7, 2016
1 parent 595dae4 commit 2a05738
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions script.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import json
from pprint import pprint

with open('data.json') as data_file:
data = json.load(data_file)
# Open the data and read each JSON object into a list
data_file = open('sample_data.json', 'r')
tweets = data_file.readlines()

pprint(data)
# Load each JSON object and print the tweetId
for line in tweets:
values = json.loads(line)
print values["tweetId"]

0 comments on commit 2a05738

Please sign in to comment.