I organized my code in two files 1) app.py 2) logic.py Where app.py is primarily streamlit UI interface to take input and display output . where logic.py is functional code for the app .
app.py
import streamlit as st
import logic as lg
ā¦
ā¦
running streamlit app
streamlit run app.py
Without stopping the streamlit server , when changes are made to app.py , streamlit identifies the modificaton to the app.py and ask for rerun
However , when changes are made to logic.py , i have to stop the server and restart streamlit app to reflect the changes in logic.py .
Is there a way streamlit can autorefresh changes in import files ( to avoid stop and restart of app)?
is the directory structure for your code as follows:
dir_to_code/
----> app.py <ā your Streamlit interface
----> logic.py <ā code that does things
Then, as you said you import logic as lg into your app.py file. But when you update logic, the app does not auto refresh like it does with your main app.py script?