Create get_configs.py
Browse files- get_configs.py +11 -0
get_configs.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import glob
|
2 |
+
import os
|
3 |
+
|
4 |
+
all_articles = glob.glob('./wiki/*.json')
|
5 |
+
file_names = [os.path.splitext(os.path.basename(path))[0] for path in all_articles]
|
6 |
+
_TIMES = sorted(file_names) + ['all']
|
7 |
+
|
8 |
+
# Write the string to a Python file
|
9 |
+
with open('configs.txt', 'w') as file:
|
10 |
+
for time in _TIMES:
|
11 |
+
file.write(time + '\n')
|