Created
April 27, 2016 16:00
-
-
Save milljm/aff0446cba572f9eb1b542914d3d30d3 to your computer and use it in GitHub Desktop.
Argument Parser
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 | |
import argparse | |
def parseArguments(args=None): | |
parser = argparse.ArgumentParser(description='argparse tester') | |
parser.add_argument('-t', '--test', nargs="?", const='moose', help='None, default=moose, or value') | |
return parser.parse_args(args) | |
if __name__ == '__main__': | |
args = parseArguments() | |
print args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment