행위

Python streamlit dashboard

DB CAFE

Dbcafe (토론 | 기여)님의 2024년 7월 11일 (목) 18:56 판
thumb_up 추천메뉴 바로가기


1 파이썬 Streamlit 대시보드 개발[편집]

1.2 실행 방법[편집]

streamlit run test.py

1.3 Streamlit 샘플[편집]

  • 샘플 소스
import streamlit as st
st.title('Hello Streamlit')
  • 실행
streamlit run app.py

1.4 문자열 관련[편집]

import streamlit as st

# 타이틀
st.title('this is title')
# 헤더 
st.header('this is header')
# 서브헤더
st.subheader('this is subheader')

1.5 레이아웃 만들기[편집]

  • 레이아웃으로 웹페이지 분할
  • columns 함수
import streamlit as st

col1,col2 = st.columns([2,3])
# 공간을 2:3 으로 분할하여 col1과 col2 컬럼 생성.  

with col1 :
  # column 1 에 담을 내용
  st.title('here is column1')
with col2 :
  # column 2 에 담을 내용
  st.title('here is column2')
  st.checkbox('this is checkbox1 in col2 ')


# with 구문 말고 다르게 사용 가능 
col1.subheader(' i am column1  subheader !! ')
col2.checkbox('this is checkbox2 in col2 ') 
# => 위에 with col2: 안의 내용과 같은 기능