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
180
Pythonコーディングスタイル@第2回 Kobe.py勉強会
Yosuke Onoue
June 04, 2016
Tweet
Share
More Decks by Yosuke Onoue
See All by Yosuke Onoue
Think About Front-end Web Development with Rust
likr
2
430
Yewにおけるoff-the-main-thread
likr
1
620
行政事業レビューデータの可視化 / Visualization of Japan's National Budget with JUDGIT!
likr
1
160
モダンJavaScript再入門 / Re-introduction to Modern JavaScript
likr
23
11k
Web-based Data Visualization with Rust and WebAssembly
likr
4
5.1k
Introduction to Graph Drawing
likr
0
390
20190707Ionic_Meetup.pdf
likr
0
350
About the end of the web
likr
2
450
Rust + WebAssemblyで広がるWebの未来
likr
16
6.5k
Other Decks in Technology
See All in Technology
Cloud Deploy と仲良くなりたい
phaya72
1
100
データ化エンジニアとしての1年を振り返る
sansantech
PRO
3
250
Ask-LLM論文紹介: How to Train Data-Efficient LLMs
s_ota
0
110
Elementaryを用いたデータ品質の可視化とデータ基盤の運用改善
10xinc
6
1.4k
データマネジメントを支える武器としてのメタデータ管理
10xinc
1
360
複数の LLM モデルを扱う上で直面した辛みまとめ
kazuyaseki
1
230
継続的テストモデルを実現するためにスリーアミーゴスを用いた10Xでのシフトレフトの事例
nihonbuson
3
160
KTC_DBRE.pdf
_awache
0
290
MongoDB Atlas Vectorsearchではじめる生成AIアプリ開発
chie8842
3
510
Oracle Database で機械学習を始めよう! Oracle Machine Learning
oracle4engineer
PRO
1
140
ハイパフォーマンスな組織をつくるための開発生産性の考え方 / developer-productivity-high-performer-link-and-motivation
lmi
3
250
既存プロセスからの脱却と変化に適応するために必要なこと
cybozuinsideout
PRO
2
170
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1023
450k
KATA
mclloyd
14
11k
Mobile First: as difficult as doing things right
swwweet
215
8.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
111
35k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
[RailsConf 2023] Rails as a piece of cake
palkan
21
3.8k
RailsConf 2023
tenderlove
0
510
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
18
1.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
257
12k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Building an army of robots
kneath
300
41k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
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 !