Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,23 @@ import streamlit as st
|
|
2 |
from streamlit.components.v1 import html
|
3 |
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
from streamlit_cookies_controller import CookieController
|
7 |
|
8 |
st.set_page_config('Cookie QuickStart', 'πͺ', layout='wide')
|
|
|
2 |
from streamlit.components.v1 import html
|
3 |
|
4 |
|
5 |
+
state = st.session_state
|
6 |
+
if 'my_value' not in state:
|
7 |
+
state['my_value'] = None
|
8 |
+
if st.button('Set value'):
|
9 |
+
state['my_value'] = 'some_value'
|
10 |
+
if state['my_value'] is not None:
|
11 |
+
st.write(f'<a href="?my_param={state["my_value"]}">Click here to see the value in the URL</a>')
|
12 |
+
|
13 |
+
if state['my_value'] is not None:
|
14 |
+
st.markdown(state['my_value'])
|
15 |
+
|
16 |
+
if state['my_value'] is not None:
|
17 |
+
st.write(f'<a href="?my_param={state["my_value"]}">Click here to see the value in the URL</a>')
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
from streamlit_cookies_controller import CookieController
|
23 |
|
24 |
st.set_page_config('Cookie QuickStart', 'πͺ', layout='wide')
|