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
Eelで作ってみる WHOISアプリと スライド
Search
attakei
February 07, 2018
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Eelで作ってみる WHOISアプリと スライド
みんなのPython勉強会#32で発表したLTのスライドです
attakei
February 07, 2018
More Decks by attakei
See All by attakei
Sphinxを通して考える、「拡張」の仕方 / First approach for development sphinx extension
attakei
2
5k
PyPIデビュー手前の人のための地下活動手法 -PyPICloudを使ったプライベートレジストリの構築- / Using PyPICloud as private registry for pre-debut to PyPI
attakei
1
670
「〇〇のプラグインを作る」ことのすゝめ / Let's develop plugins
attakei
0
1.3k
プレゼン?それもSphinxで出来るよ -ドキュメントツールSphinxのちょっと変わった利用法- / You can presentation too by Sphinx!
attakei
1
1.6k
Cloud RunとFastAPIで、ChatBotをミニマムスタートしよう / Getting start ChatBot with FastAPI and Cloud RUN
attakei
0
3.3k
Web制作において、プレビューにあえてCloudRun(とFirebase)を使う / Using Cloud Run (and Firebase) as preview environment of HTML in web development
attakei
0
1.5k
Ansibleを通じて「べき等性」を 理解してみよう / Try understanding idempotency by Ansible
attakei
1
1.5k
素材の良さを活かしつつ、reST をReveal.jsに変換してみる話 / Converting pure reST to Revealjs
attakei
0
570
Errbotで得られる、ChatOps入門
attakei
0
1.4k
Other Decks in Programming
See All in Programming
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
120
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
610
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
120
業務時間外もAIに働いてもらう話
colorful12
3
9.7k
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
200
不幸な GC
chencmd
0
860
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
120
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
800
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
760
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
700
XHTMLが残したもの
yosuke_furukawa
PRO
1
340
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
260
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
Facilitating Awesome Meetings
lara
57
7.1k
Designing for humans not robots
tammielis
254
26k
Evolving SEO for Evolving Search Engines
ryanjones
0
280
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
260
Into the Great Unknown - MozCon
thekraken
41
2.7k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
570
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
760
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
How STYLIGHT went responsive
nonsquared
100
6.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
390
Transcript
Eelで作ってみる Eelで作ってみる Eelで作ってみる Eelで作ってみる Eelで作ってみる Eelで作ってみる WHOISアプリと WHOISアプリと WHOISアプリと WHOISアプリと
WHOISアプリと WHOISアプリと スライド スライド スライド スライド スライド スライド @attakei みんなのPython勉強会 / 2018-02-07
Kazuya Takei @attakei 個人扱い(電撃的にLTしてるので) 中央区でサーバサイド寄りエンジニアしてます 誰?
Eel A little Python library for making simple Electron-like HTML/JS
GUI apps
現在のバージョンは、0.9.1 2017年末ぐらいに公開された模様 1756 Stars 何するやつか Electron的なアプリをPythonで作るライブラリ メイン処理的な部分を、Pythonで書けるっぽい その他 What is
Eel https://github.com/ChrisKnott/Eel 今月の頭に、MOONGIFTで紹介されていました。
Demo Demo Demo Demo Demo Demo
WHOIS Zone 調べる
デモ中身 デモ中身 デモ中身 デモ中身 デモ中身 デモ中身
Python side import eel from whois import whois @eel.expose #
<-- def get_whois(zone): w = whois(zone) return str(w) eel.init('web') eel.start('slide.html')
JS side <script type="text/javascript" src="/eel.js"></script> document.getElementById('demo-zone-btn').addEventListener('click', () => { var
val = document.getElementById('demo-whois-input').value; eel.get_whois(val); // <-- Python let register = await eel.get_whois(val)(); document.getElementById('demo-zone-output').innerText = register; });
__init__.py browsers.py ちょっとだけEelの中身 import bottle as btl, bottle.ext.websocket as wbs
import eel.browsers as brw def start(*start_urls, **kwargs): # ( ) brw.open(start_urls, options) run_lambda = lambda: btl.run(host=options['host'], port=options['port'], serv # ( ) import webbrowser as wbr, sys, subprocess as sps, os # ( ) def open(start_pages, options): # ( ) sps.Popen( [chrome_path, '--app=%s' % url] + options['chromeFlags'], stdout=sps.PIPE, stderr=sps.PIPE) # ( )
bottle
Pros コアな処理をPythonで書ける そして表現をHTMLで書ける Cons デフォルトのChromeを呼び出すのでChromeのインストール 必須 例えば呼び出し時に、Chrome Portableにすれば? macだと、閉じてもChromeが残る ???s
ウィンドウを複数立ち上げて協調動作させられる可能性 Pros/Cons
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました