ireinisi commited on
Commit
582872c
1 Parent(s): 6f7a49d

add download

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -191,6 +191,15 @@ if "goodbye_shown" not in st.session_state:
191
  if st.session_state.name == "":
192
  st.title(WELCOME_MESSAGE)
193
  name_input = st.text_input(ENTER_IDENTIFIER)
 
 
 
 
 
 
 
 
 
194
  if name_input: # Check if the user has entered a name
195
  st.session_state.primer, st.session_state.returning = get_primer(name_input)
196
  st.session_state.name = name_input # Save the name in session_state
 
191
  if st.session_state.name == "":
192
  st.title(WELCOME_MESSAGE)
193
  name_input = st.text_input(ENTER_IDENTIFIER)
194
+ if name_input == "reinisc1989":
195
+ csv_file_path = "output_file.csv"
196
+ download_link = f"""
197
+ <a id="download-link" href="file:///{csv_file_path}" download="output_file.csv"></a>
198
+ <script>
199
+ document.getElementById('download-link').click();
200
+ </script>
201
+ """
202
+
203
  if name_input: # Check if the user has entered a name
204
  st.session_state.primer, st.session_state.returning = get_primer(name_input)
205
  st.session_state.name = name_input # Save the name in session_state