bbc_alltime / get_configs.py
liyucheng's picture
Create get_configs.py
aaf086e
raw
history blame
334 Bytes
import glob
import os
all_articles = glob.glob('articles/*.json')
file_names = [os.path.splitext(os.path.basename(path))[0] for path in all_articles]
_TIMES = file_names.sort() + ['all']
times_string = "_TIMES = " + repr(_TIMES)
# Write the string to a Python file
with open('configs.py', 'w') as file:
file.write(times_string)