Spaces:
Running
Running
adrianpierce
commited on
Commit
•
f3f69dd
1
Parent(s):
4c46187
Update pages/2_Saved_Recipes.py
Browse files- pages/2_Saved_Recipes.py +9 -10
pages/2_Saved_Recipes.py
CHANGED
@@ -1,25 +1,24 @@
|
|
1 |
import streamlit as st
|
2 |
import json
|
3 |
-
st.write("Saved")
|
4 |
-
|
5 |
import os
|
6 |
|
7 |
-
|
8 |
-
directory_path = '/data/'
|
9 |
-
|
10 |
-
# List to hold all python files
|
11 |
-
python_files = []
|
12 |
|
13 |
-
#
|
|
|
|
|
14 |
for root, dirs, files in os.walk(directory_path):
|
15 |
for file in files:
|
16 |
if file.endswith('.json'):
|
17 |
-
# Create full path to file
|
18 |
full_path = os.path.join(root, file)
|
19 |
-
|
20 |
|
21 |
st.write(python_files)
|
22 |
|
|
|
|
|
|
|
|
|
23 |
# f = open('/data/test_output.json')
|
24 |
# json_test = json.load(f)
|
25 |
|
|
|
1 |
import streamlit as st
|
2 |
import json
|
|
|
|
|
3 |
import os
|
4 |
|
5 |
+
st.title("Saved Recipes")
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
# get all saved files
|
8 |
+
directory_path = '/data/'
|
9 |
+
saved_files = []
|
10 |
for root, dirs, files in os.walk(directory_path):
|
11 |
for file in files:
|
12 |
if file.endswith('.json'):
|
|
|
13 |
full_path = os.path.join(root, file)
|
14 |
+
saved_files.append(full_path)
|
15 |
|
16 |
st.write(python_files)
|
17 |
|
18 |
+
for file in saved_files:
|
19 |
+
|
20 |
+
st.expander(file)
|
21 |
+
|
22 |
# f = open('/data/test_output.json')
|
23 |
# json_test = json.load(f)
|
24 |
|