vim/snippets/python.snippets @ 24c678613f0b
Lots.
author |
Steve Losh <steve@stevelosh.com> |
date |
Thu, 13 Jan 2011 12:40:43 -0500 |
parents |
f71dcc350ee4 |
children |
5f8b2ac61bf6 |
snippet #!
#!/usr/bin/env python
snippet from
from ${1:sys} import ${2:*}
snippet while
while ${1:True}:
${2:pass}
snippet for
for ${1:x} in ${2:xs}:
${3:pass}
snippet fore
for ${1:n}, ${2:item} in enumerate(${3:items}):
${4:pass}
snippet class
class ${1:ClassName}(${2:object}):
def __init__(self${3:, args}):
${4:super($1, self).__init__()}
${5}
snippet def
def ${1:function}(${2}):
${3:pass}
snippet defs
def ${1:method}(self${2}):
${3:pass}
snippet prop
@property
def ${1:method}(self${2}):
${3:pass}
snippet lam
lambda ${1:args}: ${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}
snippet ifmain
if __name__ == '__main__':
${1:main()}
snippet _
__${1:init}__${2}
snippet ***
*args, **kwargs