I am trying to run a function based on folder locations provided by text_inputs made within a form.
It is currently locally hosted, I am hoping to deploy in the future.
Python 3.12.8
streamlit==1.42.1
The text inputs only appear after a button is clicked.
The text inputs do not seem to return the data input into the form. When I print them, they print nothing in the command prompt.
Here is the code:
def custom():
with st.form('custom'):
data_path = st.text_input(
"Enter the folder where the files are saved:"
)
folder_path = st.text_input(
"Enter the folder path where you want to save the file:"
)
file_name = st.text_input(
"Enter the filename for the file (should end in .xlsx):"
)
file_name = folder_path +'\\'+ file_name
st.header("Test Type:")
measurements = [
"Shear",
"Tensile"
]
container = st.container()
test_type = container.selectbox("Test Type:", measurements)
st.header("Options")
avg_data = st.checkbox("Average Data")
st.form_submit_button('Run Model', on_click = run_custom, args = (test_type, data_path, file_name, avg_data))