Summary
I have a python code where I want to create a st.button to be clicked and once it is the python code I have for the app initiates and runs in its entirety. Eventually I want to create multiple buttons on the same page that initiate different python files. I just don’t know how to write the st.button function to initiate the code.
Steps to reproduce
Code snippet:
import streamlit as st
with header:
st.title('Welcome to my FreeWeibo Dataset')
st.button(POS.py)
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
What I want to happen is I will create a so called master app that shows the above text which will be my “homepage” and once the user clicks the button it runs the code from a python file. I currently have the python file run as a different streamlit app but I am trying to create an app that has 3 buttons that run three different python files.
Explain what you expect to happen when you run the code above.
Actual behavior:
Nothing happens at the moment since I do not have the correct syntax.
Debug info
- Streamlit version: 1.15.1
- Python version: 3.9.15
- Using Conda
- OS version: Windows 10
- Browser version: Chrome
Requirements file
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
Links
- Link to your GitHub repo:
- Link to your deployed app:
Additional information
If needed, add any other context about the problem here.