summaryrefslogtreecommitdiff
path: root/snippets/python-mode/try-argv
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-07-03 23:19:05 -0400
committerKyle Meyer <kyle@kyleam.com>2015-07-03 23:19:05 -0400
commit94511ffbd18a2f24224c539f23c2f6ffb9720eee (patch)
tree5ad6493679c107ee045734127486f26eba49c756 /snippets/python-mode/try-argv
parent24b986ca4e8eda852080d5e469d3639b119d8623 (diff)
downloademacs.d-94511ffbd18a2f24224c539f23c2f6ffb9720eee.tar.gz
Don't require newline in snippets
Diffstat (limited to 'snippets/python-mode/try-argv')
-rw-r--r--snippets/python-mode/try-argv10
1 files changed, 10 insertions, 0 deletions
diff --git a/snippets/python-mode/try-argv b/snippets/python-mode/try-argv
new file mode 100644
index 0000000..5b515ad
--- /dev/null
+++ b/snippets/python-mode/try-argv
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: try argv
+# key: targv
+# --
+try:
+ _, $1 = sys.argv
+except ValueError:
+ sys.exit(__doc__)
+
+$0 \ No newline at end of file