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
76
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
540
RustとPython
hhatto
4
2.5k
PHP Kansai 2013 LT
hhatto
0
91
Other Decks in Programming
See All in Programming
Breaking Up with Big ViewModels — Without Breaking Your Architecture (droidcon Berlin 2025)
steliosf
PRO
1
330
Your Perfect Project Setup for Angular @BASTA! 2025 in Mainz
manfredsteyer
PRO
0
130
2025年版 サーバーレス Web アプリケーションの作り方
hayatow
23
25k
CSC509 Lecture 03
javiergs
PRO
0
330
Le côté obscur des IA génératives
pascallemerrer
0
120
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1k
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
590
ててべんす独演会〜Flowの全てを語ります〜
tbsten
1
220
CSC305 Lecture 02
javiergs
PRO
1
260
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
240
株式会社 Sun terras カンパニーデック
sunterras
0
220
CI_CD「健康診断」のススメ。現場でのボトルネック特定から、健康診断を通じた組織的な改善手法
teamlab
PRO
0
180
Featured
See All Featured
Designing for humans not robots
tammielis
254
25k
Automating Front-end Workflow
addyosmani
1371
200k
Side Projects
sachag
455
43k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
960
Git: the NoSQL Database
bkeepers
PRO
431
66k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
Rails Girls Zürich Keynote
gr2m
95
14k
Code Reviewing Like a Champion
maltzj
525
40k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
It's Worth the Effort
3n
187
28k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
9
580
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