Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Streamlitで簡単webGUI

 Streamlitで簡単webGUI

Dentoo.LT #25

発表資料

さらだ

June 06, 2021
Tweet

Other Decks in Programming

Transcript

  1. これから説明すること 1. サンプルの実行 2. 文字列を表示 3. pandasのDataFrameを表示 4. Matplotlibのグラフを表示 5.

    ドロップダウンリストの利用 6. チェックリストの利用 7. markdownによる文字列の表示 9
  2. 文字列を表示 streamlit run sample00.py # sample00.py import streamlit as st

    st.write("電!気!通!信!大!学!🤔🤔🤔") st.write("U!E!C!🖖🖖🖖") 11
  3. 12

  4. pandasのDataFrameを表示 streamlit run sample01.py # sample01.py import streamlit as st

    import pandas as pd df = pd.DataFrame([["UEC","電気通信大学"], ["MIT", "マサチューセッツ工科大学"]]) st.table(df) 13
  5. 14

  6. これから説明すること 1. サンプルの実行 2. 文字列を表示 3. pandasのDataFrameを表示 4. Matplotlibのグラフを表示 5.

    ドロップダウンリストの利用 6. チェックリストの利用 7. markdownによる文字列の表示 15
  7. Matplotlibのグラフを表示 streamlit run sample02.py # sample02.py import streamlit as st

    import matplotlib.pyplot as plt fig = plt.figure() plt.plot([1,2,3,4],[8,6,7,5]) st.pyplot(fig) 16
  8. 17

  9. ドロップダウンリストの利用 streamlit run sample03.py # sample03.py import streamlit as st

    option = st.selectbox("select your university", ["UEC", "電気通信大 学", "多摩のMIT"]) st.write(f"You selected: {option}") 18
  10. 19

  11. チェックリストの利用 streamlit run sample04.py # sample04.py import streamlit as st

    check1 = st.checkbox("選択肢1") check2 = st.checkbox("選択肢2") check3 = st.checkbox("選択肢3") if check1: st.write("you checked 1") if check2: st.write("you checked 2") if check3: st.write("you checked 3") 20
  12. 21

  13. markdownによる文字列の表示 streamlit run sample05.py 22 # sample05.py import streamlit as

    st ''' # これはH1タグです ###### これはH6タグです *イタリック体* **太字** ~~打ち消し~~ > 引用
  14. 23