Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- data
- Dictionary
- matplotlib
- nan
- len()
- list
- 덴드로그램
- pandas
- hierarchical_clustering
- DataFrame
- numpy
- IN
- Machine Learning
- 최솟값
- analizer
- 분류 결과표
- count()
- del
- function
- 반복문
- wcss
- dendrogram
- 최댓값
- elbow method
- string
- DataAccess
- sklearn
- Python
- append()
- insert()
Archives
- Today
- Total
개발공부
[Streamlit] 파일 분리하여 작업하기 본문
메인으로 쓸 파일에 각각의 파일을 import 해준다.
app.py
## 파일을 분리해서 만드는 앱 ##
import streamlit as st
from app9_about import run_about
from app9_eda import run_eda
from app9_home import run_home
from app9_ml import run_ml
def main():
st.title('파일 분리 앱')
menu = ['Home', 'EDA', 'ML', 'About']
choice = st.sidebar.selectbox('메뉴', menu)
if choice == menu[0] :
run_home()
elif choice == menu[1] :
run_eda()
elif choice == menu[2] :
run_ml()
elif choice == menu[3] :
run_about()
if __name__ == '__main__':
main()
app_about.py
import streamlit as st
def run_about() :
st.subheader('이 앱은...')
app_eda.py
from sqlalchemy import null
import streamlit as st
import pandas as pd
import numpy as np
def run_eda() :
st.subheader('EDA 화면')
app_home.py
import streamlit as st
def run_home() :
st.subheader('홈 화면입니다.')
app_ml.py
import streamlit as st
def run_ml():
st.subheader('머신러닝 관련 화면')
'Python > Streamlit' 카테고리의 다른 글
[Streamlit] plotly를 이용한 차트그리기 (0) | 2022.05.23 |
---|---|
[Streamlit] matplotlib, seaborn을 이용한 차트 그리기 (0) | 2022.05.23 |
[Streamlit] 파일을 업로드 하는 방법, 사이드 바 만들기 (0) | 2022.05.23 |
[Streamlit] 유저에게 입력 받는 방법(문자, 숫자, 날짜, 시간, 색깔, 비밀번호) (0) | 2022.05.23 |
[Streamlit] 이미지, 비디오, 오디오 파일 출력하기 (0) | 2022.05.20 |