Created
September 27, 2016 09:19
-
-
Save balkian/196bf8a0547b679c6ee23532bd94dabb to your computer and use it in GitHub Desktop.
Rec
This file contains hidden or 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
import glob | |
import json | |
def process_file(f): | |
print(json.load(f.read()) | |
for f in glob.glob('semeval/*.json'): | |
""" Find every file in the semeval folder that matches **.json | |
""" | |
with open(f) as w: | |
process_file(w) |
This file contains hidden or 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
import os | |
def process_file(f): | |
print(json.load(f.read()) | |
for root, dirs, files in os.walk('semeval'): | |
""" Find every file in the folder tree that matches **.json | |
""" | |
for file in files: | |
if file.endswith(".json"): | |
with open(os.path.join(root, file)) as w: | |
process_file(w) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment