Spaces:
Runtime error
Runtime error
Update pages/07_Physics_Test_Sets.py
Browse files
pages/07_Physics_Test_Sets.py
CHANGED
@@ -9,8 +9,11 @@ col1, col2, col3 = st.columns(3)
|
|
9 |
|
10 |
# Function to display a clickable download link for the PDF
|
11 |
def create_pdf_link(pdf_name, file_path):
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
# Display the first PDF link as a clickable download button in the first column
|
16 |
with col1:
|
|
|
9 |
|
10 |
# Function to display a clickable download link for the PDF
|
11 |
def create_pdf_link(pdf_name, file_path):
|
12 |
+
if os.path.exists(file_path):
|
13 |
+
with open(file_path, "rb") as f:
|
14 |
+
st.download_button(label=pdf_name, data=f, file_name=pdf_name, mime="application/pdf")
|
15 |
+
else:
|
16 |
+
st.error(f"File {pdf_name} not found!")
|
17 |
|
18 |
# Display the first PDF link as a clickable download button in the first column
|
19 |
with col1:
|