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
890
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
3.7k
PyPIデビュー手前の人のための地下活動手法 -PyPICloudを使ったプライベートレジストリの構築- / Using PyPICloud as private registry for pre-debut to PyPI
attakei
1
390
「〇〇のプラグインを作る」ことのすゝめ / Let's develop plugins
attakei
0
1k
プレゼン?それもSphinxで出来るよ -ドキュメントツールSphinxのちょっと変わった利用法- / You can presentation too by Sphinx!
attakei
0
910
Cloud RunとFastAPIで、ChatBotをミニマムスタートしよう / Getting start ChatBot with FastAPI and Cloud RUN
attakei
0
2.7k
Web制作において、プレビューにあえてCloudRun(とFirebase)を使う / Using Cloud Run (and Firebase) as preview environment of HTML in web development
attakei
0
1.1k
Ansibleを通じて「べき等性」を 理解してみよう / Try understanding idempotency by Ansible
attakei
1
1k
素材の良さを活かしつつ、reST をReveal.jsに変換してみる話 / Converting pure reST to Revealjs
attakei
0
290
Errbotで得られる、ChatOps入門
attakei
0
1.2k
Other Decks in Programming
See All in Programming
ぼっちを避けて楽しむためのアノテコノテ / Various Tips and Tricks to Avoid Loneliness and Have Fun
nrslib
3
1.7k
Android開発者のための Kotlin Multiplatform入門
ntaro
0
190
APIのない大学ログインWebサービスをWKWebViewとJavaScriptでアプリ化した話
akidon0000
1
330
Namespace on read
tagomoris
2
370
Ruby メモリ管理 プログラミング
megmogmog1965
0
130
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
190
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
MIERUNE BBQにおけるユーザー中心設計()
mierune
PRO
1
110
今こそ始める、CDKコンストラクトライブラリ開発 ― 入門から実践まで
tmokmss
1
930
AWS初心者ってどうやってAWSを学ぶ?〜アプリエンジニアがやってよかったアーキテクチャ学習方法〜
yamanashi_ren01
0
190
Harnessing Large Language Models for Training-free Video Anomaly Detection
tereka114
1
1.3k
英語
s_shimotori
1
220
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
134
6.5k
GraphQLとの向き合い方2022年版
quramy
36
13k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.5k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
17
8.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
34
1.9k
The Brand Is Dead. Long Live the Brand.
mthomps
52
36k
4 Signs Your Business is Dying
shpigford
178
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
13
430
Fireside Chat
paigeccino
25
2.8k
The Invisible Customer
myddelton
117
13k
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
おまけ ちなみに イールとは ウナギのことだ カバヤキにすると うまいぞ。
〜 終 〜 〜 終 〜 〜 終 〜 〜
終 〜 〜 終 〜 〜 終 〜 ご清聴ありがとうございました