Spaces:
Runtime error
Runtime error
Create 07_Physics_Test_Sets.py
Browse files
pages/07_Physics_Test_Sets.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import os
|
3 |
+
|
4 |
+
# Title of the page
|
5 |
+
st.title("Physics Test Sets")
|
6 |
+
|
7 |
+
# Create a column layout for displaying links
|
8 |
+
col1, col2, col3 = st.columns(3)
|
9 |
+
|
10 |
+
# Function to display a clickable link for the PDF
|
11 |
+
def create_pdf_link(pdf_name, file_path):
|
12 |
+
with open(file_path, "rb") as f:
|
13 |
+
st.download_button(label=pdf_name, data=f, file_name=pdf_name, mime="application/pdf")
|
14 |
+
|
15 |
+
# Display the first PDF link in the first column
|
16 |
+
with col1:
|
17 |
+
st.write("Electrodynamics Test Set 1")
|
18 |
+
create_pdf_link("eJackson_set1.pdf", os.path.join("psets", "eJackson_set1.pdf"))
|
19 |
+
|
20 |
+
# Add more columns and rows as needed for additional PDFs
|
21 |
+
# Example of another row:
|
22 |
+
with col2:
|
23 |
+
st.write("Electrodynamics Test Set 2")
|
24 |
+
create_pdf_link("eJackson_set2.pdf", os.path.join("psets", "eJackson_set2.pdf"))
|
25 |
+
|
26 |
+
with col3:
|
27 |
+
st.write("Electrodynamics Test Set 3")
|
28 |
+
create_pdf_link("eJackson_set3.pdf", os.path.join("psets", "eJackson_set3.pdf"))
|
29 |
+
|
30 |
+
# More rows and columns can be added as needed
|