Python templates

Standard script

#!/usr/bin/python3
# -*- coding: utf8 -*-
#

import argparse
import sys

parser = argparse.ArgumentParser(
    description='Something very smart'
    )
parser.add_argument('--input', '-i',
                    required=True,
                    help='Some helpful text',
                    action='store_true')
"""
Rince and repeat.
"""

# Show help when running without any arguments.
if len(sys.argv)==1:
    parser.print_help(sys.stderr)
    sys.exit(1)

args = parser.parse_args()
print(args.input)