Last active
December 11, 2015 23:21
-
-
Save mojaveazure/7ac575307174ffb85696 to your computer and use it in GitHub Desktop.
An example of a switch argument in Python
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
#!/usr/bin/env python | |
import argparse | |
parser = argparse.ArgumentParser(add_help=True, description="A switch argument in Python") | |
parser.add_argument('-s', | |
'--switch', | |
help="The switch", | |
action='store_true', | |
required=False, | |
default=False) | |
print(parser.parse_args()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment