I have faced 3 problems.
Here is some:
- every time when you search for anything whole script is run again.
- I want to integrate my application with my dashboard/flask server which is running on (https://himanshupatel.pythonanywhere.com/) But I cannot able to proceed with streamlit
- How do we integrate object-oriented class with streamlit because every time it will create a new instance of an object. (i.e, This reduce efficiency)
@Jessica_Smith Thank you for suggesting this platform.
HI @HimanshuMoliya, welcome to the Streamlit community!
This is how the Streamlit execution model works. I talk more about this here:
Can you be more specific about what your issue is? What is preventing you from doing what you want?
This isn’t necessarily the case, but of course it all depends on the behavior you are trying to achieve. Can you link to your code so that we can take a look?
Best,
Randy
How do I run my streamlit application with the command “python app.py”? like flask server.
I have run my flask server with this command when I add some streamlit code
it’s throws error like this:
current_server = Server.get_current() File "C:\anaconda\lib\site-packages\streamlit\server\server.py", line 213, in get_current raise RuntimeError("Server has not been initialized yet")
Here is a code… Is this the right way to create an object in streamlit? this will create new object every time
import streamlit as st
from recommendation_engine import RecommendationEngine
# create object of our backend script
recommendationengine_obj1 = RecommendationEngine()
Streamlit apps are run by streamlit run app.py
I have run my flask server with python app.py command when I add some streamlit code
it’s throws error like this:
current_server = Server.get_current() File "C:\anaconda\lib\site-packages\streamlit\server\server.py", line 213, in get_current raise RuntimeError("Server has not been initialized yet")
If I use “streamlit run app.py” flask server functionalities not works.
Can you link to your code repo? It’s not clear to me how Flask and Streamlit are related here.
No, I can’t, code is not public. But you can take a look of the website http://himanshupatel.pythonanywhere.com/
Which is hosted on pythonanywhere.com
Now, I want to add some content/new demo of my streamlit app to the same website, where the user click on a button and streamlit page will appear, How can I do that?