[vim] Add custom Python snippets for arg_parse and ifmain
This commit is contained in:
parent
f2d42050c9
commit
efc80858d1
1 changed files with 17 additions and 0 deletions
17
vim/snippets/python.snippets
Normal file
17
vim/snippets/python.snippets
Normal file
|
@ -0,0 +1,17 @@
|
|||
# python.snippets
|
||||
# vim: set ts=8 sw=8 sts=8 noet list:
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
snippet parse_args
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
# TODO: Configure arguments here.
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
snippet ifmain
|
||||
def main():
|
||||
${1:pass}
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue