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
0
200
Pythonコーディングスタイル@第2回 Kobe.py勉強会
Yosuke Onoue
June 04, 2016
Tweet
Share
More Decks by Yosuke Onoue
See All by Yosuke Onoue
ネットワーク可視化の世界
likr
7
6.6k
Think About Front-end Web Development with Rust
likr
2
540
Yewにおけるoff-the-main-thread
likr
1
770
行政事業レビューデータの可視化 / Visualization of Japan's National Budget with JUDGIT!
likr
1
230
モダンJavaScript再入門 / Re-introduction to Modern JavaScript
likr
24
11k
Web-based Data Visualization with Rust and WebAssembly
likr
4
5.8k
Introduction to Graph Drawing
likr
0
510
20190707Ionic_Meetup.pdf
likr
0
450
About the end of the web
likr
2
530
Other Decks in Technology
See All in Technology
GCASアップデート(202506-202508)
techniczna
0
250
VPC Latticeのサービスエンドポイント機能を使用した複数VPCアクセス
duelist2020jp
0
180
JOAI発表資料 @ 関東kaggler会
joai_committee
1
270
新規案件の立ち上げ専門チームから見たAI駆動開発の始め方
shuyakinjo
0
110
実践アプリケーション設計 ③ドメイン駆動設計
recruitengineers
PRO
1
180
トヨタ生産方式(TPS)入門
recruitengineers
PRO
2
220
モバイルアプリ研修
recruitengineers
PRO
2
240
ZOZOTOWNフロントエンドにおけるディレクトリの分割戦略
zozotech
PRO
16
5.2k
制約理論(ToC)入門
recruitengineers
PRO
2
270
Postman MCP 関連機能アップデート / Postman MCP feature updates
yokawasa
0
150
Yahoo!ニュースにおけるソフトウェア開発
lycorptech_jp
PRO
0
340
イオン店舗一覧ページのパフォーマンスチューニング事例 / Performance tuning example for AEON store list page
aeonpeople
2
280
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Six Lessons from altMBA
skipperchong
28
4k
Code Reviewing Like a Champion
maltzj
525
40k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Scaling GitHub
holman
462
140k
The World Runs on Bad Software
bkeepers
PRO
70
11k
A Modern Web Designer's Workflow
chriscoyier
695
190k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
The Cult of Friendly URLs
andyhume
79
6.5k
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 !