Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Python Programming in Entertainment Industry: Coding Style


Published on

In part 2 of python series (Python Programming in Entertainment Industry), we are talking about 6 basic coding style in python that would help RD/TD in animation/game studio that would help me a lot when they are doing more and more coding in the future.

Published in: Technology
  • Be the first to comment

Python Programming in Entertainment Industry: Coding Style

  1. 1. Python Programming 101: Coding Style Shuen-Huei Guan Digimax Inc. 2009/06
  2. 2. Code Like a Pythonista: Idomatic Python
  3. 3. /* -- 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();
  4. 4. tab size:2 tab size:3 tab size:4 tab size:8
  5. 5. “ 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
  6. 6. 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:
  7. 7. autocmd BufRead *.py set list listchars=tab:»_ # ref:
  8. 8. hello, world by oskay @
  9. 9. Jump to Conclusions mat by Katkreig @ flickr