Streamlitを動かしてみよう!
4. Streamlit の最小アプリを作る
Section titled “4. Streamlit の最小アプリを作る”app.py を作成:
import streamlit as st
st.set_page_config(page_title="QUBO App", page_icon="🧩", layout="wide")st.title("Quantum Universe for You:デモアプリケーション")
with st.sidebar: st.header("パラメータ") n = st.slider("問題サイズ n", 2, 50, 10) run = st.button("最適化を実行")
st.write("ここに QUBO の可視化や結果を表示します。")
if run: st.success(f"n={n} のダミー最適化を実行しました。実装を追加してください!")- uvで作成したフォルダ内 で:
uv run streamlit run app.pyブラウザが自動で開かない場合は、表示された URL(http://localhost:8501 など)にアクセスしてください。