From f3777f928f22fa104b5a69f7ac907cc7d851c7c7 Mon Sep 17 00:00:00 2001 From: Michael Sanders Date: Sun, 5 Apr 2009 10:57:48 -0400 Subject: [PATCH] updated Python snippets --- snippets/python.snippets | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/snippets/python.snippets b/snippets/python.snippets index b86b60c..af93a5b 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -1,11 +1,12 @@ -# #!/usr/bin/python snippet #! #!/usr/bin/python -# While snippet wh while ${1:condition}: ${2:# code...} +snippet for + for ${1:needle} in ${2:haystack}: + ${3:# code...} # New Class snippet cl class ${1:ClassName}(${2:object}): @@ -34,30 +35,26 @@ snippet property # Self snippet . self. -# Try/Except -snippet try +snippet try Try/Except try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} -# Try/Except/Else -snippet trye +snippet try Try/Except/Else try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} else: ${5:pass} -# Try/Except/Finally -snippet tryf +snippet try Try/Except/Finally try: ${1:pass} except ${2:Exception}, ${3:e}: ${4:raise $3} finally: ${5:pass} -# Try/Except/Else/Finally -snippet tryef +snippet try Try/Except/Else/Finally try: ${1:pass} except ${2:Exception}, ${3:e}: