【发布时间】:2013-10-08 02:12:38
【问题描述】:
我正在阅读argparse 模块。我被 metavar 和 action 的含义卡住了
>>> parser.add_argument('integers', metavar='N', type=int, nargs='+',
... help='an integer for the accumulator')
>>> parser.add_argument('--sum', dest='accumulate', action='store_const',
... const=sum, default=max,
... help='sum the integers (default: find the max)')
我可能错过了,但从我阅读的内容来看,我找不到 metavar 的定义和
action (action="store_const", etc)。它们究竟是什么意思?
【问题讨论】: