Created
February 28, 2017 21:12
-
-
Save jfischer/19656fa5176121eb4e5a70ad07b2aadb to your computer and use it in GitHub Desktop.
Boilerplate for Python 3 command line scripts
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 python3 | |
""" | |
DESCRIBE SCRIPT HERE | |
""" | |
import sys | |
import argparse | |
def main(argv=sys.argv[1:]): | |
parser = argparse.ArgumentParser(description='WHAT THIS PROGRAM DOES.') | |
# Example arg. See https://docs.python.org/3/library/argparse.html#adding-arguments | |
parser.add_argument('--oscillation-overthrusters', default=False, | |
action='store_true', | |
help="Enable oscillation overthrusters") | |
args = parser.parse_args(args=argv) | |
# Use the args here | |
return 0 # ok status | |
if __name__=='__main__': | |
sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment