Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Streamlitで簡単webGUI
Search
さらだ
June 06, 2021
Programming
59
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Streamlitで簡単webGUI
Dentoo.LT #25
発表資料
さらだ
June 06, 2021
Transcript
26 slides
Streamlitで簡単webGUI さらだ Dentoo.LT #25 1
自己紹介 • いわゆるI科のM1 • アイカツ!3rdシーズン視聴中 • 研究室大好き 2
突然ですが これらのロゴを見たことある・知っ てる人いますか? 正解です! 僕が挑戦しては挫折した WEBバックエンドフレームワークたちです 3
なんで挫折したの? • 課題やらで忙しくなった • なんか動かなくなって諦めた • 必要じゃなくなった 4
突然ですが(2) これらのロゴを見たことある・知っ てる人いますか? 正解です! 最も有名なWEBフロントエンドフレームワークたちです 5
フロントエンドもバックエンドも勉 強したくないけど、それっぽい WEBアプリを作りたいよ。。。。 そんなあなたにおススメなのが 6
Streamlitとは? 1. Pythonのライブラリ 2. 美しいWEBアプリケーション 3. 機械学習・データサイエンティスト 7
インストール pip install streamlit 普通にインストールします 8
これから説明すること 1. サンプルの実行 2. 文字列を表示 3. pandasのDataFrameを表示 4. Matplotlibのグラフを表示 5.
ドロップダウンリストの利用 6. チェックリストの利用 7. markdownによる文字列の表示 9
サンプルを実行 streamlit hello を実行して表示されたリンク をクリック! 10
文字列を表示 streamlit run sample00.py # sample00.py import streamlit as st
st.write("電!気!通!信!大!学!🤔🤔🤔") st.write("U!E!C!🖖🖖🖖") 11
12
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
14
これから説明すること 1. サンプルの実行 2. 文字列を表示 3. pandasのDataFrameを表示 4. Matplotlibのグラフを表示 5.
ドロップダウンリストの利用 6. チェックリストの利用 7. markdownによる文字列の表示 15
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
17
ドロップダウンリストの利用 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
19
チェックリストの利用 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
21
markdownによる文字列の表示 streamlit run sample05.py 22 # sample05.py import streamlit as
st ''' # これはH1タグです ###### これはH6タグです *イタリック体* **太字** ~~打ち消し~~ > 引用
23
他 • ダークモードにも標準で対応 • ログイン関連の処理・DBの操作関連の処理は実装されていない 24
まとめ • 表・グラフを簡単に表示できる • ドロップダウンリスト・チェックリストを簡単に利用できる • テキストにmarkdownを利用できる • ダークモードにも対応 •
ログイン関連・DB関連の処理は苦手 25
ご清聴ありがとうございました 今回使用したソースコードは https://github.com/arima0714/Dentoo.LT-25 に挙げてます なんか作りたいけど、道具を使えないせいで何も作れない人 が一人でも減ってほしいです。 26 該当コードへの QRコード
Other Decks in Programming
See All in Programming
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
320
Debian JP Projectのサーバー構成
uwabami
1
190
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
AppFunctionsの内部実装を紐解く
hiroaki404
1
130
はじめてのPLATEAU
nokonoko1203
1
680
vue-tsc x TypeScript7
koukimiura
0
110
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
120
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
440
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
620
ruby/uri meets WHATWG
jinroq
0
180
Getting Started with Vibe Coding
miccheng
0
250
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.6k
Making Projects Easy
brettharned
120
6.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Product Roadmaps are Hard
iamctodd
55
13k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
How GitHub (no longer) Works
holman
316
150k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
370
New Earth Scene 8
popppiees
5
2.9k
Navigating Weather and Climate Data
rabernat
0
610