snippet #! #!/usr/bin/env python snippet imp import ${1:module} # Module Docstring snippet docs ''' File: ${1:`Filename('$1.py', 'foo.py')`} Author: ${2:`g:snips_author`} Description: ${3} ''' snippet wh while ${1:condition}: ${2:# code...} snippet for for ${1:needle} in ${2:haystack}: ${3:# code...} # If snippet if if ${1:cond}: ${2:pass} # Elif snippet elif elif ${1:cond}: ${2:pass} # If else snippet ifs if ${1:cond}: ${2:pass} else: ${3:pass} # With statement snippet with with ${1:file} as ${2:var}: ${3} # List comp snippet lstc [${3:expr} for ${1:iter} in ${2:collection}]${4} # Generator Expr snippet gen (${3:expr} for ${1:iter} in ${2:collection})${4} # New Class snippet cl class ${1:ClassName}${2:(object)}: """${3:docstring for $1}""" ${4} snippet init def __init__(self, ${1:arg}): ${2:self.$1 = $1} ${3} snippet str def __str__(self): ${1:s} = ${2} return $1 # New Function snippet def def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): """${3:docstring for $1}""" ${4:pass} snippet deff def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): ${3} # New Method snippet defs def ${1:mname}(self, ${2:arg}): ${3:pass} # New Property snippet property def ${1:foo}(): doc = "${2:The $1 property.}" def fget(self): ${3:return self._$1} def fset(self, value): ${4:self._$1 = value} # Lambda snippet ld lambda ${1:vars}: ${2:action} snippet . self. snippet try Try/Except try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} snippet try Try/Except/Else try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} else: ${5:pass} snippet try Try/Except/Finally try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} finally: ${5:pass} snippet try Try/Except/Else/Finally try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} else: ${5:pass} finally: ${6:pass} # if __name__ == '__main__': snippet ifmain if __name__ == '__main__': ${1:main()} # __magic__ snippet _ __${1:init}__${2} # Todo comment snippet td #TODO: ${1:todo} # Block Comment snippet bcmt ########################################################################### # # ${1:cursor} # ###########################################################################