我有一个包含一组图像的文件夹。如何将它的路径传递给参数解析器,我已按以下方式构造了参数解析器:
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--images", required=True, help="path to images directory")
args = vars(ap.parse_args())
我要传递的路径是home/downloads/images
当前我遇到以下错误:
usage: detect.py [-h] -i IMAGES
detect.py: error: the following arguments are required: -i/--images
试试这个:
这样称呼:
相关问题 更多 >
编程相关推荐