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參數前必須加“–”

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