Created
September 2, 2025 08:05
-
-
Save lesserfish/0a6849b52d6ef47d45c5199edd189822 to your computer and use it in GitHub Desktop.
Example of mutual exclusive groups in argparse
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
| resample_group = parser.add_mutually_exclusive_group() | |
| resample_group.add_argument("--resampling", dest="resampling", action="store_true", | |
| help="Enable resampling (default).") | |
| resample_group.add_argument("--no-resampling", dest="resampling", action="store_false", | |
| help="Disable resampling.") | |
| parser.set_defaults(resampling=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment