SlideShare una empresa de Scribd logo
1 de 79
Descargar para leer sin conexión
Python Programming 101: Coding Style




                   Shuen-Huei Guan
                   Digimax Inc.
                   2009/06
Code Like a Pythonista: Idomatic Python
/* -- C -- */                   # -- Python --
if (some condition)             def myfunction(foo, bar):
   if (some condition)             foo.boing()
       do_something(fancy);      for i in bar.fizzle(foo):
else                                baz = i**2
   this_sucks(badluck);           foo.wibble(baz)
                                   return foo, baz
/* -- another C -- */
if (condition)
   somethingsExecuted();
   alwaysExecuted(shouldNot);
alwaysExecuted();
tab size:2   tab size:3   tab size:4   tab size:8
“ general
syntax on
set modeline
set ruler
set autoindent
“set smartindent
“ search
set hlsearch
set incsearch
set showmatch
set ignorecase
set smartcase
“ mouse
set mouse=a
autocmd BufRead *.py set sw=4 sts=4 et
autocmd BufRead *.py set smartindent
   cinwords=if,elif,else,for,while,try,except,finally,def,class




# vim: set sw=4 sts=4 et hls is si nu:
autocmd BufRead *.py set list listchars=tab:»_
# ref: http://vim.wikia.com/wiki/Highlight_unwanted_spaces
hello, world by oskay @ flickr.com
Jump to Conclusions mat by Katkreig @ flickr
Python Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding Style

Más contenido relacionado

La actualidad más candente

Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.Esehara Shigeo
 
My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)abdels
 
Gdc09 Minimissile
Gdc09 MinimissileGdc09 Minimissile
Gdc09 MinimissileSusan Gold
 
5 Time Saving Bash Tricks
5 Time Saving Bash Tricks5 Time Saving Bash Tricks
5 Time Saving Bash TricksNikhil Mungel
 
Go home TypeScript, you're drunk!
Go home TypeScript, you're drunk!Go home TypeScript, you're drunk!
Go home TypeScript, you're drunk!Brainhub
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shelljaguardesignstudio
 
Python utan-stodhjul-motorsag
Python utan-stodhjul-motorsagPython utan-stodhjul-motorsag
Python utan-stodhjul-motorsagniklal
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 

La actualidad más candente (10)

Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.
 
My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)
 
Michael kontopoulo1s
Michael kontopoulo1sMichael kontopoulo1s
Michael kontopoulo1s
 
Gdc09 Minimissile
Gdc09 MinimissileGdc09 Minimissile
Gdc09 Minimissile
 
5 Time Saving Bash Tricks
5 Time Saving Bash Tricks5 Time Saving Bash Tricks
5 Time Saving Bash Tricks
 
Go home TypeScript, you're drunk!
Go home TypeScript, you're drunk!Go home TypeScript, you're drunk!
Go home TypeScript, you're drunk!
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shell
 
Python utan-stodhjul-motorsag
Python utan-stodhjul-motorsagPython utan-stodhjul-motorsag
Python utan-stodhjul-motorsag
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Embedding perl
Embedding perlEmbedding perl
Embedding perl
 

Destacado

Why Python In Entertainment Industry?
Why Python In Entertainment Industry?Why Python In Entertainment Industry?
Why Python In Entertainment Industry?Shuen-Huei Guan
 
PyConTW 2013 經驗分享
PyConTW 2013 經驗分享PyConTW 2013 經驗分享
PyConTW 2013 經驗分享Shuen-Huei Guan
 
平行化你的工作 part1
平行化你的工作 part1平行化你的工作 part1
平行化你的工作 part1Shuen-Huei Guan
 
How does Netflix Get Built and Triumphed?
How does Netflix Get Built and Triumphed?How does Netflix Get Built and Triumphed?
How does Netflix Get Built and Triumphed?Shuen-Huei Guan
 
Orchestrating the execution of workflows for media streaming service and even...
Orchestrating the execution of workflows for media streaming service and even...Orchestrating the execution of workflows for media streaming service and even...
Orchestrating the execution of workflows for media streaming service and even...Shuen-Huei Guan
 
從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章
從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章
從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章Shuen-Huei Guan
 
KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享
KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享
KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享Shuen-Huei Guan
 
Python + NoSQL in Animations
Python + NoSQL in AnimationsPython + NoSQL in Animations
Python + NoSQL in AnimationsShuen-Huei Guan
 
Python Experience in KKBOX Group
Python Experience in KKBOX GroupPython Experience in KKBOX Group
Python Experience in KKBOX GroupShuen-Huei Guan
 
Reyes and Shader Pipeline
Reyes and Shader PipelineReyes and Shader Pipeline
Reyes and Shader PipelineShuen-Huei Guan
 
AWS re:Invent 2016 Fast Forward
AWS re:Invent 2016 Fast ForwardAWS re:Invent 2016 Fast Forward
AWS re:Invent 2016 Fast ForwardShuen-Huei Guan
 
Migrate the Mission Critical Application to AWS Cloud
Migrate the Mission Critical Application to AWS CloudMigrate the Mission Critical Application to AWS Cloud
Migrate the Mission Critical Application to AWS CloudShuen-Huei Guan
 
AWS reInvent 2016 recap Taiwan
AWS reInvent 2016 recap TaiwanAWS reInvent 2016 recap Taiwan
AWS reInvent 2016 recap TaiwanShuen-Huei Guan
 
Seamless service migration with AWS Enterprise Support
Seamless service migration with AWS Enterprise SupportSeamless service migration with AWS Enterprise Support
Seamless service migration with AWS Enterprise SupportShuen-Huei Guan
 

Destacado (16)

Why Python In Entertainment Industry?
Why Python In Entertainment Industry?Why Python In Entertainment Industry?
Why Python In Entertainment Industry?
 
PyConTW 2013 經驗分享
PyConTW 2013 經驗分享PyConTW 2013 經驗分享
PyConTW 2013 經驗分享
 
平行化你的工作 part1
平行化你的工作 part1平行化你的工作 part1
平行化你的工作 part1
 
How does Netflix Get Built and Triumphed?
How does Netflix Get Built and Triumphed?How does Netflix Get Built and Triumphed?
How does Netflix Get Built and Triumphed?
 
Orchestrating the execution of workflows for media streaming service and even...
Orchestrating the execution of workflows for media streaming service and even...Orchestrating the execution of workflows for media streaming service and even...
Orchestrating the execution of workflows for media streaming service and even...
 
Spatial Disorientation
Spatial DisorientationSpatial Disorientation
Spatial Disorientation
 
從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章
從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章
從音樂走向影音服務 - KKBOX 的影音之路奮鬥史 - 序章
 
KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享
KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享
KKBOX 建置日本百萬用戶等級 Video Streaming 服務的經驗分享
 
Streaming Experience
Streaming ExperienceStreaming Experience
Streaming Experience
 
Python + NoSQL in Animations
Python + NoSQL in AnimationsPython + NoSQL in Animations
Python + NoSQL in Animations
 
Python Experience in KKBOX Group
Python Experience in KKBOX GroupPython Experience in KKBOX Group
Python Experience in KKBOX Group
 
Reyes and Shader Pipeline
Reyes and Shader PipelineReyes and Shader Pipeline
Reyes and Shader Pipeline
 
AWS re:Invent 2016 Fast Forward
AWS re:Invent 2016 Fast ForwardAWS re:Invent 2016 Fast Forward
AWS re:Invent 2016 Fast Forward
 
Migrate the Mission Critical Application to AWS Cloud
Migrate the Mission Critical Application to AWS CloudMigrate the Mission Critical Application to AWS Cloud
Migrate the Mission Critical Application to AWS Cloud
 
AWS reInvent 2016 recap Taiwan
AWS reInvent 2016 recap TaiwanAWS reInvent 2016 recap Taiwan
AWS reInvent 2016 recap Taiwan
 
Seamless service migration with AWS Enterprise Support
Seamless service migration with AWS Enterprise SupportSeamless service migration with AWS Enterprise Support
Seamless service migration with AWS Enterprise Support
 

Similar a Python Programming in Entertainment Industry: Coding Style

COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?Lloyd Huang
 
5分で始める XS - tsukuba.xs#1
5分で始める XS - tsukuba.xs#15分で始める XS - tsukuba.xs#1
5分で始める XS - tsukuba.xs#1Yuji Shimada
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
OSCON2014 : Quick Introduction to System Tools Programming with Go
OSCON2014 : Quick Introduction to System Tools Programming with GoOSCON2014 : Quick Introduction to System Tools Programming with Go
OSCON2014 : Quick Introduction to System Tools Programming with GoChris McEniry
 
Extending Python - EuroPython 2014
Extending Python - EuroPython 2014Extending Python - EuroPython 2014
Extending Python - EuroPython 2014fcofdezc
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges✅ William Pinaud
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineMatt Provost
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script ProgrammingLin Yo-An
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25Techvilla
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonakaptur
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)Olve Maudal
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"OdessaJS Conf
 
Lets make better scripts
Lets make better scriptsLets make better scripts
Lets make better scriptsMichael Boelen
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesjulien pauli
 
Scripting 101
Scripting 101Scripting 101
Scripting 101ohardebol
 
Confraria SECURITY & IT - Lisbon Set 29, 2011
Confraria SECURITY & IT - Lisbon Set 29, 2011Confraria SECURITY & IT - Lisbon Set 29, 2011
Confraria SECURITY & IT - Lisbon Set 29, 2011ricardomcm
 

Similar a Python Programming in Entertainment Industry: Coding Style (20)

COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?
 
5分で始める XS - tsukuba.xs#1
5分で始める XS - tsukuba.xs#15分で始める XS - tsukuba.xs#1
5分で始める XS - tsukuba.xs#1
 
JavaScript Primer
JavaScript PrimerJavaScript Primer
JavaScript Primer
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
OSCON2014 : Quick Introduction to System Tools Programming with Go
OSCON2014 : Quick Introduction to System Tools Programming with GoOSCON2014 : Quick Introduction to System Tools Programming with Go
OSCON2014 : Quick Introduction to System Tools Programming with Go
 
Extending Python - EuroPython 2014
Extending Python - EuroPython 2014Extending Python - EuroPython 2014
Extending Python - EuroPython 2014
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command Line
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script Programming
 
Software Exploits
Software ExploitsSoftware Exploits
Software Exploits
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25
 
Sf2 wtf
Sf2 wtfSf2 wtf
Sf2 wtf
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)
 
Gcrc talk
Gcrc talkGcrc talk
Gcrc talk
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Lets make better scripts
Lets make better scriptsLets make better scripts
Lets make better scripts
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performances
 
Scripting 101
Scripting 101Scripting 101
Scripting 101
 
Confraria SECURITY & IT - Lisbon Set 29, 2011
Confraria SECURITY & IT - Lisbon Set 29, 2011Confraria SECURITY & IT - Lisbon Set 29, 2011
Confraria SECURITY & IT - Lisbon Set 29, 2011
 

Último

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Último (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Python Programming in Entertainment Industry: Coding Style

  • 1. Python Programming 101: Coding Style Shuen-Huei Guan Digimax Inc. 2009/06
  • 2.
  • 3. Code Like a Pythonista: Idomatic Python
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. /* -- C -- */ # -- Python -- if (some condition) def myfunction(foo, bar): if (some condition) foo.boing() do_something(fancy); for i in bar.fizzle(foo): else baz = i**2 this_sucks(badluck); foo.wibble(baz) return foo, baz /* -- another C -- */ if (condition) somethingsExecuted(); alwaysExecuted(shouldNot); alwaysExecuted();
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. tab size:2 tab size:3 tab size:4 tab size:8
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. “ general syntax on set modeline set ruler set autoindent “set smartindent “ search set hlsearch set incsearch set showmatch set ignorecase set smartcase “ mouse set mouse=a
  • 29. autocmd BufRead *.py set sw=4 sts=4 et autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class # vim: set sw=4 sts=4 et hls is si nu:
  • 30. autocmd BufRead *.py set list listchars=tab:»_ # ref: http://vim.wikia.com/wiki/Highlight_unwanted_spaces
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66. hello, world by oskay @ flickr.com
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75. Jump to Conclusions mat by Katkreig @ flickr