Created
September 26, 2015 00:19
-
-
Save cfperez/18609c8dc76da9aecf36 to your computer and use it in GitHub Desktop.
Python script skeleton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Docstring | |
""" | |
def main(args=None): | |
# Pipe into head/tail w/o IOErrors | |
from signal import signal, SIGPIPE, SIG_DFL | |
signal(SIGPIPE,SIG_DFL) | |
parsed_args = _parse_args(args) | |
return 0 | |
def _parse_args(args): | |
from argparse import ArgumentParser, FileType, ArgumentDefaultsHelpFormatter | |
# formatter includes parameter defaults in -h usage info | |
parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) | |
return parser.parse_args(args) | |
if __name__ == '__main__': | |
import sys | |
sys.exit(main(sys.argv[1:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import setup, find_packages | |
setup( | |
name="package", | |
version="0.1", | |
packages=find_packages(), | |
entry_points={ | |
'console_scripts': ['script_name = package.script:main'] | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment