Improve Python snippets

This commit is contained in:
Kenneth Benzie 2019-05-15 11:56:39 +01:00
parent 054507cdff
commit 51b95acf90

View File

@ -1,15 +1,15 @@
snippet main "Python main stub"
snippet #! "Shebang"
#!/usr/bin/env python
"""${1:docstring}"""
endsnippet
snippet main "Python main stub"
from argparse import ArgumentParser
def main():
"""Main entry point."""
parser = ArgumentParser(description='${2:description}')
parser.add_argument('${3:argument}')
args = parser.parse_args()$0
parser = ArgumentParser()
parser.add_argument('${0:argument}')
args = parser.parse_args()
if __name__ == '__main__':