Created
July 25, 2012 22:15
-
-
Save wenming/3179040 to your computer and use it in GitHub Desktop.
parse json
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
#!/usr/bin/python | |
import os | |
import sys | |
import json | |
import pprint | |
file = open("twitter_stream_seq2.txt", 'r') | |
lines = file.readlines() | |
i = 0 | |
str = "" | |
for line in lines: | |
try: | |
obj = json.loads(line) | |
pp = pprint.PrettyPrinter() | |
pp.pprint(obj) | |
except ValueError: | |
print i | |
i = i + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment