import streamlit as st

def main():
    st.title("커피 주문 키오스크")
    coffee_type = st.selectbox("커피 종류", ["아메리카노", "카페라떼", "카페모카"])

    size = st.radio("사이트", ["Small", "Tall", "Grande"])
    
    toppings = st.multiselect("토핑", ["시럽", "우유", "초코소스"])

    if st.button("주문하기"):
        st.write("주문이 완료되었습니다!")
        st.write("커피 종류:", coffee_type)
        st.write("사이즈:", size)
        st.write("토핑:", toppings)

if __name__ == '__main__':
    main()

사전 준비

시작하기 전에 다음을 준비해야 합니다:

  1. Streamlit 설치:

    bash

    pip install streamlit
    
  2. 코드 실행:

코드 주요 부분 설명

  1. Streamlit 라이브러리 임포트
import streamlit as st
  1. 메인 함수 정의
def main():