liyucheng commited on
Commit
aaf086e
·
1 Parent(s): 2b56f67

Create get_configs.py

Browse files
Files changed (1) hide show
  1. get_configs.py +12 -0
get_configs.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import glob
2
+ import os
3
+
4
+ all_articles = glob.glob('articles/*.json')
5
+ file_names = [os.path.splitext(os.path.basename(path))[0] for path in all_articles]
6
+ _TIMES = file_names.sort() + ['all']
7
+
8
+ times_string = "_TIMES = " + repr(_TIMES)
9
+
10
+ # Write the string to a Python file
11
+ with open('configs.py', 'w') as file:
12
+ file.write(times_string)