StormFalcon32

Merge

Mar 25th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. import json
  2.  
  3.  
  4. tweets = {}
  5. for i in range(5):
  6.     with open('tweets%s.json' % i, encoding='utf-8') as f:
  7.         tweets.update(json.load(f))
  8. with open('tweetsmerged.json', 'w', encoding='utf-8') as f:
  9.     json.dump(tweets, f)
Advertisement
Add Comment
Please, Sign In to add comment