传递给action的参数名是什么?(argparse)

2024-03-28 23:37:11 发布

您现在位置:Python中文网/ 问答频道 /正文

start_check_stop = parser.add_mutually_exclusive_group()
start_check_stop.add_argument('-s', '--start', action=start(*what*))
start_check_stop.add_argument('-c', '--check', action=check(*what*))
start_check_stop.add_argument('-t', '--stop', action=stop(*what*))

为了将给定的命令行参数传递给函数,我需要在标记为What的位置传递什么?在


Tags: 函数命令行标记addparsercheckgroupaction