Last active
February 19, 2018 08:56
-
-
Save jmquintana79/9224cbf63e66c85e838a to your computer and use it in GitHub Desktop.
parse python script arguments
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
import argparse | |
# Functions here | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description='Create Marketing Report') | |
parser.add_argument('--accounts', | |
action='store_true', | |
help='Process Account Data') | |
parser.add_argument('--sales', | |
action='store_true', | |
help='Process Sales Data') | |
args = parser.parse_args() | |
# Process accounts | |
if args.accounts: | |
# Do something | |
# Process sales | |
if args.sales: | |
# Do Something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment