Like in the photo we can use 2 different independent session simultaneously. Even if Session1 is running something we can switch to Session2 and do other tasks.
Hey @Subin_George_Malana . According to my understanding streamlit page run from top to bottom for every widget response. It means if we select any option from drop-down list means it will run the whole application from top to bottom. So, if i choose the session1 in drop-down, you can perform some work. But you can’t provide any functionality to session2 without its get selected.
Hi @Guna_Sekhar_Venkata, thanks for the update. I wanted to use it like, whenever we want to change the session we can change the option from the dropdown. it should be like 1 Streamlit and 2 separate independent sessions. I hope this makes sense
Hi @Guna_Sekhar_Venkata, Is there any ways to do this?
I have seen people are talking about multiple logins but nobody is talking about same user but multiple sessions. can you give me some pointers on the same?
No, because each session is tied to a websocket connection between a browser tab and the application. There is no builtin way of changing that programmatically.
That is, in case you are really talking about streamlit sessions. If you mean some bespoke concept of “session” or just what the title says (“run 2 separate codes”), then the answer may be different. But you would need to be more specific.
it is basically i need to run some Py files in each nodes and get the stdout from each separately in different tabs. like a one stop point to run different codes from a single portal
A session begins when we send the command: streamlit run app.py
And open the browser on the given url.
To create a new or second session, just open another tab or window with the given url.
You can use session state to manage what you want inside a single session. If task 1 processes web scraping and task 2 is doing some regression analysis you can do so. Just manage the variables in the session states so that the app may run without issues even if there are possible code reruns. Talking about reruns, there is an upcoming awesome feature of partial rerun. Rerun can be isolated in a function.
Hi @ferdy, Thanks for responding.
What i want here is using Paramiko i want to connect to 2 different nodes and run some commands and display stdout on some widget in Streamlit. I want to run them independently in different time based on button in each tab. it should work like a Master and Slave type where Streamlit will be Master and those other systems will be slaves.
My question is once we start running something in one session, how can we do any other tasks in other session unless we wait until the 1st session tasks. The reason i am saying this is i will be printing the stdout to some widget in streamlit