我需要的是:
pro [-a xxx | [-b yyy -c zzz]]
Run Code Online (Sandbox Code Playgroud)
我尝试了这个但是没有用.有人可以帮帮我吗?
group= parser.add_argument_group('Model 2')
group_ex = group.add_mutually_exclusive_group()
group_ex.add_argument("-a", type=str, action = "store", default = "", help="test")
group_ex_2 = group_ex.add_argument_group("option 2")
group_ex_2.add_argument("-b", type=str, action = "store", default = "", help="test")
group_ex_2.add_argument("-c", type=str, action = "store", default = "", help="test")
Run Code Online (Sandbox Code Playgroud)
谢谢!