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
PyCon APAC 2013 LT
Search
Hideo Hattori
September 15, 2013
Programming
0
78
PyCon APAC 2013 LT
PEP 8 and autopep8
Hideo Hattori
September 15, 2013
Tweet
Share
More Decks by Hideo Hattori
See All by Hideo Hattori
gocloc
hhatto
0
550
RustとPython
hhatto
4
2.5k
PHP Kansai 2013 LT
hhatto
0
96
Other Decks in Programming
See All in Programming
AI時代の認知負荷との向き合い方
optfit
0
180
Gemini for developers
meteatamel
0
120
NetBSD+Raspberry Piで 本物のPSGを鳴らすデモを OSC駆動の7日間で作った話 / OSC2026Osaka
tsutsui
1
120
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
150
Raku Raku Notion 20260128
hareyakayuruyaka
0
410
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
180
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.2k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
160
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
PRO
0
180
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
160
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
190
文字コードの話
qnighy
0
130
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Bash Introduction
62gerente
615
210k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
360
Designing for Timeless Needs
cassininazir
0
140
How to make the Groovebox
asonas
2
2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Raft: Consensus for Rubyists
vanstee
141
7.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
230
Rails Girls Zürich Keynote
gr2m
96
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Transcript
PEP 8 and autopep8 PyCon APAC 2013 LT / 2013.09.15
Hideo Hattori
whoami C/Python/Zsh My Python Projects , , , ... code
on , @hhatto pgmagick otamapy genzshcomp meow Github Bitbucket
PEP 8 coding conventions for the Python code Nc”úùk1 Õúß
Õc v ”c v göpvz̈v©–− 2013.08.01 •ò&\©¤ http://www.python.org/dev/peps/pep- 0008/
PEP 8 modernisation 1 m¤ß”5ðcv •9¡−l¡ ׳•9¡−l¡ Python1.5.2 •9¡−l¡w£Œ\©–¤ß Python2/3
•9¡−l¡wûl\©¤ß http://hg.python.org/peps/rev/fb24c80e9afb
About autopep8 simple command-line tool automatic formatting for Python Code
require v0.9.4 (2013.09.08) pep8 $ pip install autopep8
For Example invalid PEP 8 code import sys, os n
= True if n != None: print("none") def f(x): return 2 * x
Output Auto-Formatting Code $ autopep8 invalid.py import sys import os
n = True if n != None: print("none") def f(x): return 2 * x
Aggressive $ autopep8 -a invalid.py import sys import os n
= True if n is not None: print("none") def f(x): return 2 * x
Print Diff $ autopep8 -d invalid.py --- original/invalid.py +++ fixed/invalid.py
@@ -1,7 +1,10 @@ -import sys, os +import sys +import os n = True if n != None: print("none") -def f(x): return 2 * x + +def f(x): + return 2 * x
Other Feature ignore/select errors max-line recursive/jobs
ofiØ#”O •PEP 8 ³
⁄¿autopep8 ³³›–Æ–z“\o
https://github.com/hhatto/autopep8
Thank you