Hello,
I just started using Streamlit. I’m building a multipage application.
The page under the root will be a welcome page explaining the various operations performed by the subpages.
Each subpage will be very complex, so my ideal workflow would be to split the contents of these subpages into partials, importend inside the subpage.
Example of how I’d like to organize my code:
app_directory
+-- welcome.py
+-- pages
+-- subpage1.py
+-- subpage2.py
+-- partials
+-- subpage1_header.py
+-- subpage1_body1.py
+-- subpage1_body2.py
+-- subpage1_footer.py
+-- subpage2_header.py
+-- subpage2_body1.py
+-- subpage2_body2.py
+-- subpage2_footer.py
I don’t want to use the magic commands, I’ll rather stick to the st.write
convention.
So my question is as follows: is it possible to put the Streamlit elements inside these partials and then import the partials in the subpage, in order to have the subpage code less complex?
If yes, could you address me to a guide on how to realize it? My attempt at doing this with import
statements didn’t work.
Thanks in advance for any help.