尝试构建参数解析器时出现错误,请帮助我解决它

时间:2019-12-30 13:46:09

标签: python-3.x argparse

我输入的代码和错误消息

ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image to be OCR'd")
ap.add_argument("-p", "--preprocess", type=str, default="thresh", help="type of preprocessing to be 
                 done, choose from blur, linear, cubic or bilateral")
args = vars(ap.parse_args())

错误消息

用法:ipykernel_launcher.py [-h] -i图像[-p预处理] ipykernel_launcher.py:错误:需要以下参数:-i /-image 发生异常,请使用%tb查看完整的追溯。 系统退出:2

0 个答案:

没有答案