Argparse“ArgumentError: argument -h/--help: conflicting option string(s): -h, --help”

前端 未结 2 1290
情歌与酒
情歌与酒 2021-02-05 00:29

Recently, I am learning argparse module, Argument error occurred below the code

import argparse
import sys


class ExecuteShell(object):
    def create(self, arg         


        
2条回答
  •  误落风尘
    2021-02-05 00:47

    argparse adds --help and -h options by default. If you don't want to use the built-in help feature, you need to disable it with:

    parser = argparse.ArgumentParser(add_help=False)
    

    See the documentation

提交回复
热议问题