Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

argparse mutually exclusive

import argparse

parser = argparse.ArgumentParser()

group = parser.add_mutually_exclusive_group()
group.add_argument('-a', action='store_true')
group.add_argument('-b', action='store_true')

print parser.parse_args()
Comment

PREVIOUS NEXT
Code Example
Python :: tkinter navigate pages 
Python :: seaborn create a correlation matrix 
Python :: python pandas apply to one column 
Python :: how to multi random pick from list python 
Python :: get length of csv file with python 
Python :: python cd to script directory 
Python :: ddos in python 
Python :: matplotlib legend out of plot 
Python :: how to print numbers from 1 to 20 in python 
Python :: matplotlib 3D plots reduce margins 
Python :: import numpy Illegal instruction (core dumped) 
Python :: pandas groupby as new column 
Python :: discord.py play mp3 file 
Python :: python dockerfile 
Python :: xgboost feature importance 
Python :: fraction thesis 
Python :: pprint python 
Python :: how to spread an array in python 
Python :: how to read excel file in jupyter notebook 
Python :: python year from date 
Python :: mean deviation python 
Python :: custom 404 page flask 
Python :: update python 3.10 ubuntu 
Python :: jupyter plot not showing 
Python :: python os output to variable 
Python :: Import "decouple" could not be resolved Pylance 
Python :: cv2 videocapture nth frame 
Python :: display text in pygame 
Python :: input stdout python 
Python :: cv2 resize 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =