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
8
6.7k
Think About Front-end Web Development with Rust
likr
2
540
Yewにおけるoff-the-main-thread
likr
1
780
行政事業レビューデータの可視化 / Visualization of Japan's National Budget with JUDGIT!
likr
1
240
モダンJavaScript再入門 / Re-introduction to Modern JavaScript
likr
24
11k
Web-based Data Visualization with Rust and WebAssembly
likr
4
5.9k
Introduction to Graph Drawing
likr
0
520
20190707Ionic_Meetup.pdf
likr
0
460
About the end of the web
likr
2
540
Other Decks in Technology
See All in Technology
ラスベガスの歩き方 2025年版(re:Invent 事前勉強会)
junjikoide
0
640
어떤 개발자가 되고 싶은가?
arawn
1
300
初海外がre:Inventだった人間の感じたこと
tommy0124
1
120
Zero Trust DNS でより安全なインターネット アクセス
murachiakira
0
130
設計に疎いエンジニアでも始めやすいアーキテクチャドキュメント
phaya72
18
11k
Azure Well-Architected Framework入門
tomokusaba
1
150
GCASアップデート(202508-202510)
techniczna
0
140
SRE × マネジメントレイヤーが挑戦した組織・会社のオブザーバビリティ改革 ― ビジネス価値と信頼性を両立するリアルな挑戦
coconala_engineer
0
320
GPUをつかってベクトル検索を扱う手法のお話し~NVIDIA cuVSとCAGRA~
fshuhe
0
290
様々なファイルシステム
sat
PRO
0
270
新米エンジニアをTech Leadに任命する ー 成長を支える挑戦的な人と組織のマネジメント
naopr
1
310
猫でもわかるAmazon Q Developer CLI 解体新書
kentapapa
1
180
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.7k
Scaling GitHub
holman
463
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Done Done
chrislema
185
16k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
900
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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 !