Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PyScriptの話
Search
2bo
July 11, 2023
Technology
0
190
PyScriptの話
Python東海 第43回勉強会 発表資料
2bo
July 11, 2023
Tweet
Share
More Decks by 2bo
See All by 2bo
巨大ガジェット買ってみた
2bo
0
470
ZabbixAPIをつんつんした
2bo
0
320
名古屋とお菓子🍪
2bo
0
320
名古屋 勉強会 会場 選定 2019
2bo
2
140
お城Pythonの作り方/OshiroPython
2bo
1
620
Python勉強法
2bo
0
790
Python 環境構築方法 2016
2bo
2
1.7k
Python東海の紹介(仮).py
2bo
0
330
pep8を読んでみよう.pdf
2bo
0
230
Other Decks in Technology
See All in Technology
Demystifying Vite Internals
nozomuikuta
2
210
管理画面とユーザー機能の調和を取り戻す!~クエリパフォーマンス改善の成功物語~ / Restore harmony between administrative and user functions!
minisera
1
190
いまいまMySQL2024 @ OSC Nagaoka
sakaik
3
270
巨大企業でDX革新を起こすということ BTCONJP 2024
yamaken66
0
160
最新のWasm事情
askua
5
2.5k
ReSTIRの数理と実装 (rtcamp10)
yumcyawiz
1
450
俺とVSCode Python Debugger Extension
sat
PRO
1
140
組織デバイスのための効率的なアプリケーション更新戦略
kenchan0130
0
450
さくっと実践!Postmanを活用した高品質で持続可能なAPI管理
yokawasa
5
350
KongによるAPIライフサイクル マネジメント
hashitokyo
1
160
Amplify Gen 2ではじめる 生成AIアプリ開発入門
tsukuboshi
0
390
パートナー企業のテクニカルサポートエンジニアとして気になる、より良い AWS サポートの利活用について
kazzpapa3
0
180
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.5k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
How to train your dragon (web standard)
notwaldorf
87
5.6k
Navigating Team Friction
lara
183
14k
GitHub's CSS Performance
jonrohan
1030
450k
Optimizing for Happiness
mojombo
375
69k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
59k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Practical Orchestrator
shlominoach
186
10k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Transcript
͓લ୭Α • ͓ࣄ αʔόʔNWΠϯϑϥԂࣇʹ͋ • झຯ ञɺຊɺϘʔυήʔϜ •
ॅΜͰΔͱ͜ ذෞʢ໊ݹͷ২ຽʣ • ίϛϡχςΟɿPython౦ւɺRaspberryPiUGɺଞ • Twitterɿ@2box2bo (΄΅͍ͳ͍) • ကɿ@
[email protected]
(͍͍ͩͨͬͪ͜) • Python౦ւୈ20ճ͘Β͍?͔ΒࢀՃ
ͳΜͱ͔GPTͱ͔ྲྀߦͬͯΔͷͰ
ڈͪΐͬͱʹͳͬͨ PyScriptͷͰ͠·͔͢
PyScriptͷ͓ Python౦ւ ୈ43ճษڧձ 2023/7/8 @2box2bo
PyScript ͬͯ·͔͢?
PyScriptͬͯԿऀ? • PyCon US 2022ͷΩʔϊʔτͰAnaconda͕ൃ දͨ͠ϒϥβͰಈ͘Python • ʮRun Python in
Your HTMLʯ • https://pyscript.net/
ϒϥβͰಈ͘ʁ
ϒϥβͰಈ͘ • WebαʔόʔͰಈ࡞ͰPythonΛಈ͔͢Θ͚Ͱ ͳ͘ɺWebϒϥβͰPythonΛಈ͔͢ • Python࣮ߦڥͷΠϯετʔϧWebϒϥ βͰಈ͔͢ͷͰෆཁ • WebAssemblyΛ༻
ͳΜͷͬͪ͜Ό? ͬͯͳΔͷͰ Ұͭͮͭઆ໌͍ͯ͘͠
WebAssemblyͬͯ? • ݩʑWebϑϩϯτΤϯυͷߴԽٕज़ͱͯ͠ ੜ • ུশWasm • RustC++ͷιʔεΛWasmʹίϯύΠϧͯ͠ JavaScriptΑΓߴʹಈ͔ٕ͢ज़ •
Disney+ͱ͔AmazonPrimeVideoͰΘΕ͍ͯΔ • PythonͷιʔείʔυWasmίϯύΠϧͰ͖ͳ ͍
Python͑ͳ͍͡ΌΜ
PyodideͬͯͷͰ͑Δ
Pyodide? • Pythonͷιʔείʔυ͕WasmίϯύΠϧͰ͖ͳ ͍ͷͰɺPython࣮ߦڥ(PythonΠϯλϓϦλ)Λ WasmίϯύΠϧͨ͠ͷ • PythonιʔείʔυΛPyodideͰ࣮ߦ͢Δ • ࠷৽0.23.3ͰPython3.11.2ΛWasmίϯύΠϧ •
…ಡΈํʮͺ͍͓͍ͩͲʯ…ʁ • ৄࡉͪ͜Β https://pyodide.org/en/stable/
Pyodided͚ͩͰPython࣮ߦ • Pyodided͚ͩͰPythonΛಈ͔ͤΔʂ • ʮpyodide.runPython(`Pythonίʔυ`);ʯ • ࢼͯ͠ΈΔͱΘ͔Γ·͕͢ɺ͜Εॻ͖ͮΒ ͍…
͜͜·Ͱͷ·ͱΊ • WebAssembly(Wasm)Λ͏ͱWebϒϥβ Ͱ৭ʑͰ͖Δ • PythonΛWasmίϯύΠϧ͢Δ͜ͱͰ͖ͳ͍ • Python࣮ߦڥΛWasmίϯύΠϧͨ͠ Pyodided͕͋Δ͕ͪΐͬͱ͍ʹ͍͘
Α͏͘PyScriptͷʹΔ
ͰɺPyScriptͬͯʁ • WebϒϥβͰಈ͘Python࣮ߦڥ • PyodidedΛ͍ͨ͘͢͠ͷ͕PyScript • PyScriptΛಡΈࠐΜͰɺ<py-script>λάͰғΜ ͩதʹPythonίʔυॻ͚ಈ͘ • ϒϥβίϯιʔϧݟͳͯ݁͘Ռදࣔ͞ΕΔ
• ͪΖΜJavaScriptͱ࿈ܞͰ͖Δ
ಈ࡞Πϝʔδ͕… • ͜Μͳײ͡Ͱಈ͍͍ͯΔ • https://anaconda.cloud/pyscript-python-in-the-browser •
ͱ͍͏͜ͱͰσϞ
σϞ • σϞίʔυ https://github.com/2bobo/PyScript-demo • ެࣜαϯϓϧ https://pyscript.net/examples/ •
·ͱΊ
PyScript·ͱΊ • Webϒϥβ্ͰPythonΛಈ͔͢͜ͱ͕Ͱ͖Δ • Python࣮ߦڥͷΠϯετʔϧෆཁʂ • (ͨΓલ͚ͩͲ)ಈ࡞͍ • ·ͩ·ͩ։ൃத͚ͩͲࠓޙظ͍ͯ͠Δ •
Կʹ͑Δ͔ʁ·ͩ·ͩ͜Ε͔Β • Anaconda͕ؔΘ͍ͬͯΔͷਖ਼…
͓ΘΓ