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
Pythonコーディングスタイル@第2回 Kobe.py勉強会
Search
Yosuke Onoue
June 04, 2016
Technology
210
0
Share
Pythonコーディングスタイル@第2回 Kobe.py勉強会
Yosuke Onoue
June 04, 2016
More Decks by Yosuke Onoue
See All by Yosuke Onoue
ネットワーク可視化の世界
likr
8
7k
Think About Front-end Web Development with Rust
likr
2
580
Yewにおけるoff-the-main-thread
likr
1
840
行政事業レビューデータの可視化 / Visualization of Japan's National Budget with JUDGIT!
likr
1
270
モダンJavaScript再入門 / Re-introduction to Modern JavaScript
likr
24
12k
Web-based Data Visualization with Rust and WebAssembly
likr
4
6.2k
Introduction to Graph Drawing
likr
0
550
20190707Ionic_Meetup.pdf
likr
0
490
About the end of the web
likr
2
570
Other Decks in Technology
See All in Technology
How to learn AWS Well-Architected with AWS BuilderCards: Security Edition
coosuke
PRO
0
190
The Making of AI Chips
pfn
PRO
0
560
いつの間にかデータエンジニア以外の業務も増えていたけど、意外と経験が役に立ってる
zozotech
PRO
0
740
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.4k
Loadbalancing exporter internals
ymotongpoo
1
120
TSKaigi 2026 - 型プラグインシステムの実装に使われるテクニック
teamlab
PRO
1
120
AWS WAFの運用を地道に改善し、自社で運用可能にするプラクティス
andpad
1
630
Claude Code で使える DuckDB Skills を試してみた / DuckDB Skills and Claude Code
masahirokawahara
1
1.9k
Fラン学生が考える、AI時代のデザインに執着した突破口
husengs7
1
230
Purview Endpoint DLP 動かしてみた
kozakigh
1
460
はじめてのAI-DLC
yoshidashingo
0
140
既存プロダクトQAから新規プロダクトQAへ
ryotakahashi
0
170
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
550
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.1k
Thoughts on Productivity
jonyablonski
76
5.2k
Balancing Empowerment & Direction
lara
6
1.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Documentation Writing (for coders)
carmenintech
77
5.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
HDC tutorial
michielstock
2
670
Transcript
PythonίʔσΟϯάελΠϧ ͓ͷ͏͑(@_likr) Kobe.py ୈ2ճษڧձ
ࣗݾհ • ͓ͷ͏͑ (@_likr) • ژେֶ ࡦͷͨΊͷՊֶϢχοτ ಛఆॿڭ • ng-kyoto
ΦʔΨφΠβʔ GDGਆށ ελοϑ • ՄࢹԽΞϓϦέʔγϣϯͷ Webϕʔε࣮
ίʔσΟϯάελΠϧΛ ؾʹ͍ͯ͠·͔͢ʁ
ίʔσΟϯάελΠϧ • ίʔσΟϯάنɺελΠϧΨΠυ • ίʔυͷॻ͖ํʹؔ͢ΔϧʔϧΛ ·ͱΊͨυΩϡϝϯτ • ಉ͡ಈ͖ͷίʔυͷΑΓྑ͍ॻ͖ํΛنఆ͢Δ • There
should be one-- and preferably only one -- obvious way to do it. (The Zen of Python)
ίʔσΟϯάελΠϧΛकΔͱ • όάΛੜΈ͍͢ίʔυΛճආͰ͖Δ • νʔϜͰίʔυͷ౷ҰɺඇଐਓԽ͕Ͱ͖Δ • ॻ͖ํͷ໎͍͕ݮΔ • ຊ࣭తͳίʔσΟϯάʹूதͰ͖Δ •
ϨϏϡʔ࣌ʹࠣࡉͳϛεͷࢦఠΛ༧Ͱ͖Δ ίʔσΟϯάελΠϧΛकͬͯੜ࢈ੑΛߴΊΑ͏
ίʔσΟϯάελΠϧΛܾΊΔ • ࣗͰ࡞ͬͨͷ • ࣗͷձࣾɾνʔϜ͕࡞ͬͨͷ • ଞͷձࣾɾ৫͕࡞ͬͨͷ • Google Python
Style Guide https://google.github.io/styleguide/pyguide.html • ίϛϡχςΟ͕࡞ͬͨͷ • PEP 8 ͍ͷʹר͔ΕΑ͏
The Zen of Python • PythonϓϩάϥϚ͕͖࣋ͭ৺ߏ͑ http://qiita.com/IshitaTakeshi/items/ e4145921c8dbf7ba57ef • import
this
PEP 8 • Style Guide for Python Code https://www.python.org/dev/peps/pep-0008/
ελΠϧνΣοΫπʔϧΛ͏ • υΩϡϝϯτ௨ΓʹϧʔϧΛकΔͷඇৗʹࠔʂ • νΣοΫπʔϧͷͳ͍ϧʔϧڧ੍ྗ͕ऑ͍ • ίʔυͷͲ͕͜ϧʔϧʹ͍ͯ͠Δ͔πʔϧͰνΣοΫ • ࣗಈϑΥʔϚοτͷରԠ •
CIͷΈࠐΈ
PythonͷओཁͳελΠϧνΣοΫπʔϧ • pep8 • pyflakes • flake8 • flake8-pep257 •
hacking • pylint • pychecker
pep8 • https://pypi.python.org/pypi/pep8 • http://pep8.readthedocs.io/en/latest/intro.html • PEP 8͕कΒΕ͍ͯΔ͔νΣοΫ͢Δ • ແࢹϧʔϧͳͲઃఆՄೳ
pyflakes • https://pypi.python.org/pypi/pyflakes • ίʔυͷΤϥʔνΣοΫ • typoʹΑΔະ༻มɺະఆٛมͷνΣοΫ • ߴͳνΣοΫ
flake8 • https://pypi.python.org/pypi/flake8 • pep8 + pyflakes + McCabeͷ॥తෳࡶνΣοΫ •
ϓϥάΠϯػߏ • ॥తෳࡶ • ϓϩάϥϜͷ੍ޚϑϩʔ͕ͲΕ͚ͩෳࡶ͔Λଌఆ
flake8-pep257 • https://pypi.python.org/pypi/flake8-pep257 • ίʔυυΩϡϝϯτ(docstring)ͷελΠϧνΣοΫ • flake8ͷϓϥάΠϯ • PEP 257
https://www.python.org/dev/peps/pep-0257/
hacking • https://pypi.python.org/pypi/hacking • http://docs.openstack.org/developer/hacking/ • OpenStackࣾͷελΠϧΨΠυ • flake8ͷϓϥάΠϯ •
ͱͯݫ͍͠
ΤσΟλɺIDEͱͷ࿈ܞ • ίʔσΟϯά్தͰελΠϧϛεΛνΣοΫ • ৗ࣌νΣοΫͰྑ͍ίʔσΟϯάελΠϧΛֶश • Vim • syntastic https://github.com/scrooloose/syntastic
• Emacs • Sublime Text • Atom • PyCharm
·ͱΊ • ίʔσΟϯάελΠϧΛकͬͯੜ࢈ੑΛߴΊΑ͏ • PythonίϛϡχςΟϕʔεͷίʔσΟϯάελΠ ϧ͕ॆ࣮͍ͯ͠ΔͷͰ׆༻͠Α͏ • ίʔσΟϯάελΠϧνΣοΫπʔϧΛ׆༻͠Α͏
Enjoy Hacking !