Skip to content

Instantly share code, notes, and snippets.

@yorktronic
Created August 23, 2016 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorktronic/178c3ff07da7a8d108347357dfea2cd6 to your computer and use it in GitHub Desktop.
Save yorktronic/178c3ff07da7a8d108347357dfea2cd6 to your computer and use it in GitHub Desktop.
try except example
tweets_data_path = '../data/twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try:
tweet = json.loads(line)
tweets_data.append(tweet)
except:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment