运行程序时报错:

usage: main_gui_batcmm.py [-h] {Run Reset} ...

main_gui_batcmm.py: error: argument command: invalid choice: 'Run' (choose from 'Run Reset')

from gooey import Gooey, GooeyParser@Gooey(program_name="BattCommunicate_GUI")
def gui_main():parser = GooeyParser(description="BattCommunicate_GUI")subs_list = parser.add_subparsers(help="cmms", dest="command")sub_action1 = subs_list.add_parser("Run Reset")sub_action1.add_argument("Reset Cmms",metavar="reset",default="")args = parser.parse_args()print(" Start print")print(args, flush=True)  # flush=true会立即把缓存内存的东西打印出来, 打印TextField内容if __name__ == '__main__':gui_main()

解决:问题出在这个解析的动作命名: Run Reset, 带了空格,需要去掉空格。

sub_action1 = subs_list.add_parser("Run Reset")

sub_action1 = subs_list.add_parser("Run_Reset") # 这样就可以运行正常。

python gui Gooey 报错 error: argument command: invalid choice:相关推荐

  1. python中遇到报错OSError: [Errno 22] Invalid argument的解决方法

    将时间戳用python语言转换成指定日期: 代码如下: import timetimeStamp = 1589018284000 timeArray = time.localtime(timeStam ...

  2. Python PIP Mysql-python 报错 ERROR: Command errored out with exit status 1: python setup.py egg_info C

    pip install mysql-python 安装Mysql-python时,报错,先看下错误内容: ERROR: Command errored out with exit status 1:c ...

  3. Docker报错Error spawning command line “dbus-launch --autolaunch=xxx --binary-syntax --close-stderr”

    环境: ubuntu 18 报错描述: Error spawning command line "dbus-launch --autolaunch=a3d9197b765643568af09 ...

  4. Python安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法

    我们在使用 pip 安装 python 包时,经常会出现如下错误: ERROR: Could not find a version that satisfies the requirement xxx ...

  5. 微信小程序报错 Error: errCode: -501007 invalid parameters | errMsg: Invalid Key Name: _openid

    错误原因: _openid不能主动设置 错误代码: db.collection('FixedStore').add({data: {fixedAudit: false, //审核状态fixedMerc ...

  6. python pip 安装报错 error in setup command: use_2to3 is invalid. 解决方法

    问题 安装anyjson==0.3.3这个库,其他库也有可能发生 error in anyjson setup command: use_2to3 is invalid. 解决 pip install ...

  7. python 导包报错:ERROR: Could not find a version that satisfies the requirement dateutil

    terminal执行脚本: pip install python-dateutil

  8. 故障分析 | 报错 ERROR 5270 -HY000-- object not in RECYCLE BIN 引发的几个思考

    作者:姚嵩 不知道是地球人还是外星人,知道的可以留言告诉小编- 本文来源:原创投稿 *爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源. 现象: 通过show recycle ...

  9. python下载第三方库的时候报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the

    python下载第三方库的时候报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the l ...

最新文章

  1. MIT | 一种可解释的PPI预测模型
  2. Javascript JQuery获取当前元素的兄弟元素/上一个/下一个元素(转)
  3. 奠定了整个计算机科学的基础是什么,冯 诺依曼对计算机科学发展所作的贡献是什么...
  4. 深度学习100例-卷积神经网络(CNN)识别神奇宝贝小智一伙 | 第16天
  5. SIGIR 2021 | 推荐系统中的多行为建模
  6. Fiori as a Service - FaaS - Creation of inline task option is not available
  7. 属性页中的ON_UPDATE_COMMAND_UI
  8. OC-成员变量的作用域
  9. 【JEECG dubbo专题】Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
  10. MyEclipse安装EGit插件方法
  11. 案例:实现第一个Filter程序
  12. dismiss ios pop效果_iOS实现自定义炫酷的弹出视图(popView)
  13. hdu 5144 NPY and shot(三分)
  14. SQL导入/导出Excel
  15. 访问win10的远程桌面(Remote Desktop)总是凭据或者用户密码错误
  16. 树莓派专用msata硬盘转接板
  17. 樊登读书搞定读后感_《读懂一本书:樊登读书法》读后感10篇
  18. 微信发送语音功能测试用例
  19. Python Turtle绘图[难度2星]:横切的橙子(配色优化——邻近色/反差色)
  20. 中英文常用标点符号统一清洗为英文格式

热门文章

  1. mysql中的rman备份_RMAN优缺点及RMAN备份及恢复步骤
  2. P2984 [USACO10FEB]Chocolate Giving S【SPFA】
  3. 中文和英文用不同的样式
  4. 可信计算(Trusted Computing)
  5. 考研英语 大学英语教材 全新版大学英语综合教程 的一些总结
  6. 强生、赛诺菲、葛兰素史克、武田等巨头纷纷加注在华投资 | 跨国药企在中国...
  7. 电视连接后显示服务器异常,电视老显示链接服务器异常
  8. 王者服务器12月维护,12月28日周版本更新维护内容公告
  9. VC6 Add Files to Folder 崩溃问题解决办法
  10. Adding visible gpu devices: 0 每次运行到这里卡很久