import os import streamlit as st from st_pages import add_page_title, hide_pages add_page_title() def readFiles(folder_path='/Users/iurysilva/Downloads/lpremun/Out/EPS/2023/08/consolidado'): filenames = os.listdir(folder_path) selected_filename = st.selectbox('Selecione o arquivo para download', filenames) return os.path.join(folder_path, selected_filename) filename = readFiles() st.write('Arquivo selecionado `%s`' % filename) with open(filename, "rb") as file: if st.download_button(label="Baixar planilha",data=file,file_name='Almaviva.xlsx'): st.success('Arquivo baixado com sucesso')