【问题标题】:python3 getopt.GetoptError: option not recognizedpython3 getopt.GetoptError:无法识别选项
【发布时间】:2020-05-17 20:24:54
【问题描述】:
optlist, args = getopt.getopt(sys.argv[1:], 'l:s:pd', ['load=', 'save=', 'print', 'delete'])

我传递了参数--load duplicates.json,我得到了这个异常。它出什么问题了?

raise GetoptError(_('option --%s not recognized') % opt, opt) getopt.GetoptError: option --save duplicates.json not recognized

我在窗户上以防万一。

【问题讨论】:

    标签: python windows command-line arguments getopt


    【解决方案1】:

    您在 load 参数之后缺少 =

    你应该像这样传递参数:--load=duplicates.json

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 2014-08-21
      • 2020-07-02
      • 2018-02-06
      相关资源
      最近更新 更多