Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PyCon APAC 2013 LT
Search
Hideo Hattori
September 15, 2013
Programming
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PyCon APAC 2013 LT
PEP 8 and autopep8
Hideo Hattori
September 15, 2013
More Decks by Hideo Hattori
See All by Hideo Hattori
gocloc
hhatto
0
580
RustとPython
hhatto
4
2.7k
PHP Kansai 2013 LT
hhatto
0
110
Other Decks in Programming
See All in Programming
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
120
スマート反転とウェブアクセシビリティ
camiha
0
200
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
610
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
110
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
100
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
180
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
970
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.8k
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
140
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.6k
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
300
Java 27新機能 / Java 27 new features
kishida
2
110
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
450
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Music & Morning Musume
bryan
47
7.4k
The SEO identity crisis: Don't let AI make you average
varn
0
560
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Measuring & Analyzing Core Web Vitals
bluesmoon
9
990
The Curse of the Amulet
leimatthew05
2
14k
A better future with KSS
kneath
240
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Six Lessons from altMBA
skipperchong
29
4.5k
Ruling the World: When Life Gets Gamed
codingconduct
0
330
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