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
4.9k
PyPIデビュー手前の人のための地下活動手法 -PyPICloudを使ったプライベートレジストリの構築- / Using PyPICloud as private registry for pre-debut to PyPI
attakei
1
650
「〇〇のプラグインを作る」ことのすゝめ / Let's develop plugins
attakei
0
1.3k
プレゼン?それもSphinxで出来るよ -ドキュメントツールSphinxのちょっと変わった利用法- / You can presentation too by Sphinx!
attakei
1
1.5k
Cloud RunとFastAPIで、ChatBotをミニマムスタートしよう / Getting start ChatBot with FastAPI and Cloud RUN
attakei
0
3.2k
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
550
Errbotで得られる、ChatOps入門
attakei
0
1.4k
Other Decks in Programming
See All in Programming
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
560
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
290
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
710
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
180
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
210
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
Performance Engineering for Everyone
elenatanasoiu
0
170
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
6
1.3k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
840
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Abbi's Birthday
coloredviolet
2
8.1k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
GraphQLとの向き合い方2022年版
quramy
50
15k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
840
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
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました