Spaces:
Sleeping
Sleeping
Download app.py from rafatjah/LinkAndQueryStrings: direct link, hf CLI and curl.
- Browser
- Download file 532 Bytes
-
https://huggingface.co/spaces/rafatjah/LinkAndQueryStrings/resolve/main/app.py
- Command line
-
hf download hf://spaces/rafatjah/LinkAndQueryStrings/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rafatjah/LinkAndQueryStrings/resolve/main/app.py
532 Bytes
| import streamlit as st | |
| st.title('Links & Query Strings') | |
| with st.container(): | |
| st.subheader('Current page info:') | |
| st.write(st.query_params) | |
| st.link_button("Link to main page", "/") | |
| st.link_button("Link to main page with query params", "/?key=val") | |
| st.link_button("Link to this page", "page1") | |
| st.link_button("Link to this page with query params", "page1?key=val") | |
| def from_dict(): | |
| st.query_params.from_dict({"key123": "val123"}) | |
| with st.container(): | |
| st.button("from dict", on_click=from_dict) | |