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
650
Eelで作ってみる WHOISアプリと スライド
みんなのPython勉強会#32で発表したLTのスライドです
attakei
February 07, 2018
Tweet
Share
More Decks by attakei
See All by attakei
PyPIデビュー手前の人のための地下活動手法 -PyPICloudを使ったプライベートレジストリの構築- / Using PyPICloud as private registry for pre-debut to PyPI
attakei
1
160
「〇〇のプラグインを作る」ことのすゝめ / Let's develop plugins
attakei
0
540
プレゼン?それもSphinxで出来るよ -ドキュメントツールSphinxのちょっと変わった利用法- / You can presentation too by Sphinx!
attakei
0
230
Cloud RunとFastAPIで、ChatBotをミニマムスタートしよう / Getting start ChatBot with FastAPI and Cloud RUN
attakei
0
1.8k
Web制作において、プレビューにあえてCloudRun(とFirebase)を使う / Using Cloud Run (and Firebase) as preview environment of HTML in web development
attakei
0
670
Ansibleを通じて「べき等性」を 理解してみよう / Try understanding idempotency by Ansible
attakei
1
580
素材の良さを活かしつつ、reST をReveal.jsに変換してみる話 / Converting pure reST to Revealjs
attakei
0
130
Errbotで得られる、ChatOps入門
attakei
0
1k
Ansibleで作る、AWSで「器の大きい」Omnibus-GitLab
attakei
2
1.8k
Other Decks in Programming
See All in Programming
Airflowはすごいぞ!
hankehly
0
360
React NativeアプリにStorybook CSF3.0を導入しよう
texmeijin
0
150
One does not simply: migrating to Android 12 🤯
oleur
1
120
io22 extended What's new in app performance
veronikapj
0
320
エンジニアによる事業指標計測のススメ
doyaaaaaken
1
170
How we run a Realtime Puzzle Fighting Game on AWS Serverless
falken
0
240
PythonユーザによるRust入門
rmizuta3
9
3k
Beyond Micro Frontends: Frontend Moduliths for the Enterprise @wad2022
manfredsteyer
PRO
0
120
Git・Git-Flowについて
nerusan_main
0
400
Migrating to Kotlin State & Shared Flows
heyitsmohit
1
180
インターン生・新卒向け、学校でもっと教えてほしいITエンジニア基本スキル
nearme_tech
0
120
Java アプリとAWS の良い関係 - AWS でJava アプリを実行する一番簡単な方法教えます / AWS for Javarista
kanamasa
2
1.1k
Featured
See All Featured
How to Ace a Technical Interview
jacobian
265
21k
Adopting Sorbet at Scale
ufuk
63
7.6k
Code Reviewing Like a Champion
maltzj
506
37k
Bash Introduction
62gerente
597
210k
Debugging Ruby Performance
tmm1
65
10k
Fontdeck: Realign not Redesign
paulrobertlloyd
73
4.1k
The Mythical Team-Month
searls
209
39k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
498
130k
Unsuck your backbone
ammeep
659
55k
Designing on Purpose - Digital PM Summit 2013
jponch
106
5.6k
What the flash - Photography Introduction
edds
61
10k
Side Projects
sachag
450
37k
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
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました