Hey everyone.
I am trying to start the Streamlit from the python file. After first start, I have started the get the error of ReportContext and nothing starts. Since Streamlit will work from another engineering program, I need to start it from the python file. Can you add some magical codes and make it work?
import sys
from streamlit import cli as stcli
import streamlit as st
def main():
# Your streamlit code
st.title("Trial")
if __name__ == '__main__':
if st._is_running_with_streamlit:
main()
else:
sys.argv = ["streamlit", "run", sys.argv[0]]
sys.exit(stcli.main())