python - How to make each tweet on its own line? -


i wanting have each tweet on own line.

currently, breaks @ each response (i listed response_1...i using through response_10)

any ideas?

#!/usr/bin/env python  import urllib import json  response_1 = urllib.urlopen("http://search.twitter.com/search.json?q=microsoft&page=1") in response_1:     print (i, "\n") 

you have parse json python object first, can iterate on it.

#!/usr/bin/env python                                                                                                import urllib import json  response_1 = json.loads(urllib.urlopen("http://search.twitter.com/search.json?q=microsoft&page=1").read()) in response_1['results']:     print (i, "\n") 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -