Name of the Streamlit feature whose docs need improvement:st.navigation and st.Page
What you think the docs should say:
There should be stated somewhere in the docs (I think both in st.navigation and st.Page) that the code for the page must be on the root of the page.
That might seem obvious, but I was migrating some code to be on a page, and in that code I previously used if __name__ == '__main__': to separate the main code from the functions. I thought that since st.navigation uses run() to run the navigation, maybe creating a run() function inside the page would work, but it didn't.
Link to doc page in question (if any): https://docs.streamlit.io/develop/api-reference/navigation/st.page
Name of the Streamlit feature whose docs need improvement:
st.navigation
andst.Page
What you think the docs should say: There should be stated somewhere in the docs (I think both in
st.navigation
andst.Page
) that the code for the page must be on the root of the page.That might seem obvious, but I was migrating some code to be on a page, and in that code I previously used
if __name__ == '__main__':
to separate the main code from the functions. I thought that sincest.navigation
usesrun()
to run the navigation, maybe creating arun()
function inside the page would work, but it didn't.