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
6k
Think About Front-end Web Development with Rust
likr
2
510
Yewにおけるoff-the-main-thread
likr
1
720
行政事業レビューデータの可視化 / Visualization of Japan's National Budget with JUDGIT!
likr
1
210
モダンJavaScript再入門 / Re-introduction to Modern JavaScript
likr
24
11k
Web-based Data Visualization with Rust and WebAssembly
likr
4
5.6k
Introduction to Graph Drawing
likr
0
470
20190707Ionic_Meetup.pdf
likr
0
400
About the end of the web
likr
2
500
Other Decks in Technology
See All in Technology
ディスプレイ広告(Yahoo!広告・LINE広告)におけるバックエンド開発
lycorptech_jp
PRO
0
340
組織におけるCCoEの役割とAWS活用事例
nrinetcom
PRO
4
120
Cracking the Coding Interview 6th Edition
gdplabs
14
28k
OPENLOGI Company Profile
hr01
0
60k
Aurora PostgreSQLがCloudWatch Logsに 出力するログの課金を削減してみる #jawsdays2025
non97
1
190
Share my, our lessons from the road to re:Invent
naospon
0
140
データベースの負荷を紐解く/untangle-the-database-load
emiki
2
500
Change Managerを活用して本番環境へのセキュアなGUIアクセスを統制する / Control Secure GUI Access to the Production Environment with Change Manager
yuj1osm
0
100
RemoveだらけのPHPUnit 12に備えよう
cocoeyes02
0
270
Goで作って学ぶWebSocket
ryuichi1208
3
2.7k
LINEギフトにおけるバックエンド開発
lycorptech_jp
PRO
0
270
ウォンテッドリーのデータパイプラインを支える ETL のための analytics, rds-exporter / analytics, rds-exporter for ETL to support Wantedly's data pipeline
unblee
0
120
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Building Your Own Lightsaber
phodgson
104
6.2k
Documentation Writing (for coders)
carmenintech
67
4.6k
Code Reviewing Like a Champion
maltzj
521
39k
Automating Front-end Workflow
addyosmani
1368
200k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Bootstrapping a Software Product
garrettdimon
PRO
306
110k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Site-Speed That Sticks
csswizardry
4
400
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 !