seawolf2357 commited on
Commit
970d605
Β·
verified Β·
1 Parent(s): f9f0069

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
 
3
- # νŽ˜μ΄μ§€ μ„€μ •: λ ˆμ΄μ•„μ›ƒμ„ 'wide' λͺ¨λ“œλ‘œ λ³€κ²½
4
  st.set_page_config(layout="wide")
5
 
6
  # μ‚¬μ΄λ“œλ°” 타이틀 μ„€μ •
@@ -15,10 +15,24 @@ menus = {
15
  "Scripts": ["Script"]
16
  }
17
 
18
- # 메뉴 및 μ„œλΈŒλ©”λ‰΄ 선택 처리
19
- selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
20
- sub_menus = menus[selected_menu]
21
- selected_sub_menu = st.sidebar.selectbox("Sub Menu", sub_menus)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  # 'Template Video'κ°€ μ„ νƒλ˜μ—ˆμ„ λ•Œ λΉ„λ””μ˜€ 가러리λ₯Ό ν‘œμ‹œ
24
  if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
 
1
  import streamlit as st
2
 
3
+ # νŽ˜μ΄μ§€ μ„€μ •
4
  st.set_page_config(layout="wide")
5
 
6
  # μ‚¬μ΄λ“œλ°” 타이틀 μ„€μ •
 
15
  "Scripts": ["Script"]
16
  }
17
 
18
+ # μ„ νƒλœ 메뉴 및 ν•˜λΆ€ 메뉴 μ΄ˆκΈ°ν™”
19
+ selected_menu = None
20
+ selected_sub_menu = None
21
+
22
+ # 각 메뉴별 ν•˜λΆ€ 메뉴λ₯Ό 펼침
23
+ for menu_name, sub_menus in menus.items():
24
+ with st.sidebar.expander(menu_name):
25
+ # ν•˜λΆ€ 메뉴λ₯Ό 선택할 수 μžˆλŠ” selectbox 생성
26
+ selected = st.selectbox(f"Select {menu_name} option", [""] + sub_menus, key=menu_name)
27
+ if selected:
28
+ selected_menu = menu_name
29
+ selected_sub_menu = selected
30
+
31
+ # μ„ νƒλœ 메뉴와 ν•˜λΆ€ 메뉴에 λ”°λ₯Έ λ‚΄μš© ν‘œμ‹œ
32
+ if selected_menu and selected_sub_menu:
33
+ st.subheader(f"{selected_menu} > {selected_sub_menu}")
34
+ # 여기에 μ„ νƒλœ 메뉴에 λ”°λ₯Έ μ½˜ν…μΈ  ν‘œμ‹œ 둜직 μΆ”κ°€
35
+
36
 
37
  # 'Template Video'κ°€ μ„ νƒλ˜μ—ˆμ„ λ•Œ λΉ„λ””μ˜€ 가러리λ₯Ό ν‘œμ‹œ
38
  if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":