Skip to content

Instantly share code, notes, and snippets.

@mgalardini
Created September 14, 2017 09:31
Show Gist options
  • Save mgalardini/95f36698d206b3cd4368313278602143 to your computer and use it in GitHub Desktop.
Save mgalardini/95f36698d206b3cd4368313278602143 to your computer and use it in GitHub Desktop.
Minimal python script template
#!/usr/bin/env python
'''Description here'''
import logging
import argparse
def get_options():
description = ''
parser = argparse.ArgumentParser(description=description)
parser.add_argument('name',
help='Name')
return parser.parse_args()
def set_logging(level=logging.INFO):
logger = logging.getLogger()
logger.setLevel(level)
ch = logging.StreamHandler()
logger.addHandler(ch)
return logger
if __name__ == "__main__":
options = get_options()
logger = set_logging()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment