import argparse
#初始化
ap = argparse.ArgumentParser()
#自定义参数(简写,全写,是否必需,说明)
ap.add_argument("-i","--image",required = True, help = "Path to the image")
ap.add_argument("-o","--output",required = True, help = "Path to the output")
#获取所有的参数
args = vars(ap.parse_args())
#获取具体的参数,根据参数全写
image = args["image"]
#或者
output = args.output