eaglelandsonce commited on
Commit
a14013e
·
verified ·
1 Parent(s): a56dc07

Update pages/07_Physics_Test_Sets.py

Browse files
Files changed (1) hide show
  1. pages/07_Physics_Test_Sets.py +4 -0
pages/07_Physics_Test_Sets.py CHANGED
@@ -9,6 +9,10 @@ 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
  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")
 
9
 
10
  # Function to display a clickable download link for the PDF
11
  def create_pdf_link(pdf_name, file_path):
12
+ # Ensure the file name ends with '.pdf'
13
+ if not pdf_name.endswith(".pdf"):
14
+ pdf_name += ".pdf"
15
+
16
  if os.path.exists(file_path):
17
  with open(file_path, "rb") as f:
18
  st.download_button(label=pdf_name, data=f, file_name=pdf_name, mime="application/pdf")