Download app.py from Jangsoo/test: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/spaces/Jangsoo/test/resolve/main/app.py
- Command line
-
hf download hf://spaces/Jangsoo/test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Jangsoo/test/resolve/main/app.py
1.48 kB
| import streamlit as st | |
| st.title('Unit 5. Layouts & Containers') | |
| st.caption('์ฐธ์กฐ์ฌ์ดํธ: https://docs.streamlit.io/library/api-reference/layout') | |
| # sidebar- with ์ฌ์ฉํ๊ธฐ ๐ง ๐ฑ ๐ | |
| with st.sidebar: | |
| st.header('1. Sidebar') | |
| add_selectbox = st.sidebar.selectbox('์ด๋ป๊ฒ ์ฐ๋ฝ๋๋ฆด๊น์?', | |
| ('Email', 'Mobile', 'Ofice Phone') | |
| ) | |
| if add_selectbox == 'Email': | |
| st.sidebar.title('๐ง') | |
| elif add_selectbox == 'Mobile': | |
| st.sidebar.title('๐ฑ') | |
| elif add_selectbox == 'Ofice Phone': | |
| st.sidebar.title('๐') | |
| # columns | |
| Cat = 'https://images.pexels.com/photos/2071873/pexels-photo-2071873.jpeg?auto=compress&cs=tinysrgb' | |
| Dog = 'https://images.pexels.com/photos/3361739/pexels-photo-3361739.jpeg?auto=compress&cs=tinysrgb' | |
| Owl = 'https://images.pexels.com/photos/3737300/pexels-photo-3737300.jpeg?auto=compress&cs=tinysrgb' | |
| st.header('2. Columns') | |
| col1, col2, col3 = st.columns(3) | |
| with col1: | |
| st.text('Cat') | |
| st.image(Cat) | |
| with col2: | |
| st.text('Dog') | |
| st.image(Dog) | |
| with col3: | |
| st.text('Owl') | |
| st.image(Owl) | |
| # # tabs - width=200 | |
| st.header('3. Tabs') | |
| tab1, tab2, tab3 = st.tabs(['Cat', 'Dog', 'Owl']) | |
| with tab1: | |
| st.text('Cat') | |
| st.image(Cat, caption='This is a cat', width=300) | |
| with tab2: | |
| st.text('Dog') | |
| st.image(Dog, caption='This is a dog', width=300) | |
| with tab3: | |
| st.text('Owl') | |
| st.image(Owl, caption='This is an owl', width=300) |