Last active
October 30, 2019 15:53
-
-
Save tldrafael/57ac8384d147ddfe01c2173b8b633810 to your computer and use it in GitHub Desktop.
Snippet to use parseargs
This file contains hidden or 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 | |
def parse_args(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-e', type=str, help='Environment variable', required=True, dest='var1', | |
choices=['staging', 'production']) | |
parser.add_argument('--hypertuning', help='Run hypertuning process', action='store_true', dest='var2') | |
return parser.parse_args() | |
if __name__ == '__main__': | |
args = parse_args() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment