贊助廠商

娛樂城推薦

首頁

刊登資訊

  • 刊登者:匿名
  • 時間:2021-06-08 03:10:15

尚未解答Python- 有關argument

Python- 有關argument

請問一個問題, 為何這樣寫會出現錯誤呢

[程式碼片段]
parser_e = subparsers.add_parser('role', help='map', description='role arguments')
parser_e.add_argument('role', nargs='+', choices=['map'],
help='role command, available parameter is map')
subsubparsers = parser_e.add_subparsers()
parser_ee = subsubparsers.add_parser('map', help='create | list', description='role map arguments')
parser_ee.add_argument('map', nargs='+', choices=['create','list'],
help='map command, available parameter is create, list')

[執行命令]
tool role map list

[錯誤返回]
role: error: invalid choice: 'list' (choose from 'map')

--

~meow ★ Butter Yuki Cat ★ meow~
△ △ ★ ╭ ╦╗ ═ ╭╬╗ ═╦═ ╦ ╬═╬ ╠╣ ╬═╬ ★ ▲ ▲
=▏ ̄▕= ★ ╬╬║║ ║║║ ║ ║ ╠═╣ ╠╬╗╭╦╗ ★ =███=
\_/ ★ ║║║╩╗ ═ ╠╬╣ ═╬═ ╬ ╠═╣ ╭═╣╠╬╣ ★ ◥█◤
ζ∕ ﹨ ★ ╚╬║ ║ ║║║║ ║╮ ║ ╩═╩ ╭═╣║║║ ★ ▌█▋▋

--

0個答案 Python- 有關argument

其他問題

友站連結