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
0
1k
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
2
4.3k
PyPIデビュー手前の人のための地下活動手法 -PyPICloudを使ったプライベートレジストリの構築- / Using PyPICloud as private registry for pre-debut to PyPI
attakei
1
510
「〇〇のプラグインを作る」ことのすゝめ / Let's develop plugins
attakei
0
1.1k
プレゼン?それもSphinxで出来るよ -ドキュメントツールSphinxのちょっと変わった利用法- / You can presentation too by Sphinx!
attakei
1
1.3k
Cloud RunとFastAPIで、ChatBotをミニマムスタートしよう / Getting start ChatBot with FastAPI and Cloud RUN
attakei
0
3k
Web制作において、プレビューにあえてCloudRun(とFirebase)を使う / Using Cloud Run (and Firebase) as preview environment of HTML in web development
attakei
0
1.3k
Ansibleを通じて「べき等性」を 理解してみよう / Try understanding idempotency by Ansible
attakei
1
1.3k
素材の良さを活かしつつ、reST をReveal.jsに変換してみる話 / Converting pure reST to Revealjs
attakei
0
430
Errbotで得られる、ChatOps入門
attakei
0
1.3k
Other Decks in Programming
See All in Programming
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
230
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
110
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
540
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
290
Datadog RUM 本番導入までの道
shinter61
1
300
単体テストの始め方/作り方
toms74209200
0
490
関数型まつりレポート for JuliaTokai #22
antimon2
0
120
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
320
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
860
Gleamという選択肢
comamoca
6
740
無関心の谷
kanayannet
0
180
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
310
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
790
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Raft: Consensus for Rubyists
vanstee
140
7k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
480
Automating Front-end Workflow
addyosmani
1370
200k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Adopting Sorbet at Scale
ufuk
77
9.4k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
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
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました