2018-09-26Argparse中action的可选参数st

2018-09-26  本文已影响102人  HellyCla

parser.add_argument('-c', action='store_true', default=false)

python test.py -c => c是true(因为action)

python test.py => c是false(default)

上一篇 下一篇

猜你喜欢

热点阅读