-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamlit_day23_app.py
30 lines (21 loc) · 1.06 KB
/
streamlit_day23_app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st
st.title('st.experimental_get_query_params')
with st.expander('About this app'):
st.write("`st.experimental_get_query_params` allows the retrieval of query parameters directly from the URL of the user's browser.")
# 1. 手順
st.header('1. Instructions')
st.markdown('''
In the above URL bar of your internet browser, append the following:
`?name=Jack&surname=Beanstalk`
after the base URL `http://share.streamlit.io/dataprofessor/st.experimental_get_query_params/`
such that it becomes
`http://share.streamlit.io/dataprofessor/st.experimental_get_query_params/?firstname=Jack&surname=Beanstalk`
''')
# 2.st.experimental_get_query_paramsのコンテンツ
st.header('2. Contents of st.experimental_get_query_params')
st.write(st.experimental_get_query_params())
# 3.URLからの情報の取得と表示
st.header('3. Retrieving and displaying information from the URL')
firstname = st.experimental_get_query_params()['firstname'][0]
surname = st.experimental_get_query_params()['surname'][0]
st.write(f'Hello **{firstname} {surname}**, how are you?')