project1 / frontend /test1.py
rssaem
start ..
290381f
Raw
History Blame Contribute Delete
583 Bytes
#pip install streanlit
#์‹คํ–‰๋ฐฉ๋ฒ• : streamlit run test1.py
import streamlit as st
import pandas as pd
# 1. ํƒ€์ดํ‹€ ์ ๊ธฐ
st.title("๋‚˜์˜ ์ฒซ ๋ฐ์ดํ„ฐ ๋Œ€์‹œ๋ณด๋“œ")
# 2. ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๋ฐ›๊ธฐ
name = st.text_input("์ด๋ฆ„์„ ์ž…๋ ฅํ•˜์„ธ์š”:", "ํ™๊ธธ๋™")
age = st.slider("๋‚˜์ด๋ฅผ ์„ ํƒํ•˜์„ธ์š”:", 0, 100, 25)
# 3. ํ™”๋ฉด์— ์ถœ๋ ฅํ•˜๊ธฐ
st.write(f"์•ˆ๋…•ํ•˜์„ธ์š”! {age}์„ธ {name}๋‹˜ ๋ฐ˜๊ฐ€์›Œ์š”.")
# 4. ๋ฐ์ดํ„ฐํ”„๋ ˆ์ž„๊ณผ ์ฐจํŠธ ๊ทธ๋ฆฌ๊ธฐ
data = pd.DataFrame({"์—ฐ๋„": [2024, 2025, 2026], "๋งค์ถœ": [100, 150, 230]})
st.line_chart(data.set_index("์—ฐ๋„"))