I have, in my Main.py file, the switch_page function which works perfectly for me to go to any page within my pages folder. However, when I try to utilise this same command in one of the pages within the folder, it just reloads the page. Is there an easy fix?
From the docs:
The specified page must be recognized by Streamlit’s multipage architecture (your main Python file or a Python file in a
pages/
folder). Arbitrary Python scripts cannot be passed tost.switch_page
.
So I can switch to one of my pages while in main but not while in another page? I’m a bit confused by that.
This works to switch to my stock input page inside my pages folder
This doesn’t work while I’m inside the pages folder.
My file directory goes as follows:
1-Main.py
1-pages (into 2)
2-Stock_Input.py
2-Create_Prediction.py
2-Previous_Predictions.py
2-Historical_Data.py
I’ve looked through the documentation which seems to have this work without the problem I’m having. If you could help me to understand that would be appreciated thanks!
I don’t understand your file directory and having the code as pictures instead of text doesn’t help, but it doesn’t look like the examples, at all.
I can see you are using buttons. Be careful in using buttons.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.