Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Eelで作ってみる WHOISアプリと スライド
attakei
February 07, 2018
Programming
0
700
Eelで作ってみる WHOISアプリと スライド
みんなのPython勉強会#32で発表したLTのスライドです
attakei
February 07, 2018
Tweet
Share
More Decks by attakei
See All by attakei
Sphinxを通して考える、「拡張」の仕方 / First approach for development sphinx extension
attakei
0
2.3k
PyPIデビュー手前の人のための地下活動手法 -PyPICloudを使ったプライベートレジストリの構築- / Using PyPICloud as private registry for pre-debut to PyPI
attakei
1
240
「〇〇のプラグインを作る」ことのすゝめ / Let's develop plugins
attakei
0
680
プレゼン?それもSphinxで出来るよ -ドキュメントツールSphinxのちょっと変わった利用法- / You can presentation too by Sphinx!
attakei
0
400
Cloud RunとFastAPIで、ChatBotをミニマムスタートしよう / Getting start ChatBot with FastAPI and Cloud RUN
attakei
0
2.1k
Web制作において、プレビューにあえてCloudRun(とFirebase)を使う / Using Cloud Run (and Firebase) as preview environment of HTML in web development
attakei
0
740
Ansibleを通じて「べき等性」を 理解してみよう / Try understanding idempotency by Ansible
attakei
1
710
素材の良さを活かしつつ、reST をReveal.jsに変換してみる話 / Converting pure reST to Revealjs
attakei
0
160
Errbotで得られる、ChatOps入門
attakei
0
1k
Other Decks in Programming
See All in Programming
Workshop on Jetpack compose
aldefy
0
140
%q is for Quine
koic
0
400
ポケモンで学ぶiOS 16弾丸ツアー 🚅
giginet
PRO
1
610
PHPアプリケーションにおけるアーキテクチャメトリクスについて / Architecture Metrics in PHP Applications
isanasan
1
220
AWS App Runnerがそろそろ本番環境でも使い物になりそう
n1215
PRO
0
940
TokyoR#103_DataProcessing
kilometer
0
520
Remix + Cloudflare Pages + D1 で ポケモン SV のレンタルチームを検索できるアプリを作ってみた
kuroppe1819
4
1.3k
Glance App Widgetでウィジェットを作ろう / MoT TechTalk #15
mot_techtalk
0
110
Quarto Tips for Academic Presentation
nicetak
0
910
Amebaブログの会員画面システム刷新の道程
ryotasugawara
1
220
僕が考えた超最強のKMMアプリの作り方
spbaya0141
0
180
コンピュータビジョンセミナー2 / computer_vision_seminar_libSGM
fixstars
0
320
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
643
54k
Ruby is Unlike a Banana
tanoku
93
9.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
32
1.8k
Thoughts on Productivity
jonyablonski
49
2.7k
How STYLIGHT went responsive
nonsquared
89
4.2k
Rails Girls Zürich Keynote
gr2m
87
12k
Web Components: a chance to create the future
zenorocha
304
40k
Designing Experiences People Love
moore
130
22k
It's Worth the Effort
3n
177
26k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
351
21k
Code Review Best Practice
trishagee
50
11k
The Brand Is Dead. Long Live the Brand.
mthomps
48
2.9k
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
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました