server.py: error: the following arguments are required: image

标题server.py: error: the following arguments are required: image

File “E:\Anaconda3\lib\argparse.py”, line 2488, in exit
_sys.exit(status)
原因:参数没加–
更改前:ap.add_argument(“image”, type=int,default=1)
更改后:ap.add_argument("–image", type=int,default=1)
为什么会遇到这个问题?设置python带参输入时不会出现,但是,设置default就有问题了,也就是说设置default参数前必须加“–”

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章