argparse 是python自带的命令行参数解析包,可以用来方便地读取命令行参数。
在argparse 中有action可选参数
举个例子
parser.add_argument('-c', action='store_true')
#python test.py -c => c是true(触发)
#python test.py => c是false(无触发)
parser.add_argument('-c', action='store_false')
#python test.py -c => c是false(触发)
#python test.py => c是true(无触发)