5

argparseを使用すると、次の行があります。

parser.add_argument("-p", "--parameter", type=str, default=None, nargs='+',
                        help="some option",
                        choices=allValues.keys()
                        )

結果のhelpメッセージには、次のすべての値が表示されますallValues

-p {a、b、c、d、e、f、g、h、i、l、m; a ,b ,c , d, e, f, g, h, i, l, m} [{a ,b ,c , d, e, f, g, h, i, l, m} ...] , -- パラメータ {a ,b ,c , d, e, f, g, h, i, l, m; a、b、c、d、e、f、g、h、i、l、m} [{a、b、c、d、e、f、g、h、i、l、m; a ,b ,c , d, e, f, g, h, i, l, m} ...] いくつかのオプション

上記を削除 して、パラメータの名前とヘルプメッセージだけを表示することはできますか?{a ,b ,c , d, e, f, g, h, i, l, m; a ,b ,c , d, e, f, g, h, i, l, m}

4

2 に答える 2