Created
October 7, 2015 19:51
-
-
Save bl4ck5un/584c8faff5c9bb882b04 to your computer and use it in GitHub Desktop.
Dead simple argparse example
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 http://stackoverflow.com/a/7427376/1616210 | |
parser = argparse.ArgumentParser(description='Description of your program') | |
parser.add_argument('-f','--foo', help='Description for foo argument', required=True) | |
parser.add_argument('-b','--bar', help='Description for bar argument', required=True) | |
args = vars(parser.parse_args()) | |
if args['foo'] == 'Hello': | |
# code here | |
if args['bar'] == 'World': | |
# code here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment