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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
attakei
February 07, 2018
Programming
1.1k
0
Share
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
640
「〇〇のプラグインを作る」ことのすゝめ / 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
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
280
OSもどきOS
arkw
0
440
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
720
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
880
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
今さら聞けないCancellationToken
htkym
0
220
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
110
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
450
Webフレームワークの ベンチマークについて
yusukebe
0
120
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
820
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
310
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
210k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
Rails Girls Zürich Keynote
gr2m
96
14k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
230
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
WENDY [Excerpt]
tessaabrams
11
38k
Believing is Seeing
oripsolob
1
140
Chasing Engaging Ingredients in Design
codingconduct
0
210
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Building Adaptive Systems
keathley
44
3k
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
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました