Skip to content
Advertisement

How to parse arguments in python (spyder)?

I am following this tutorial and trying to run the below part of the script. I am using python 3.7 and spyder 3.3.4.

JavaScript

I have tried going to Run > Configuration per file and entering the arguments as advised by this post and and this post.

command line options: path1, path2, path3, path4

I filled out the appropriate paths for the arguments above and then ran the script, but go the error below.

usage: train.py [-h] -d DATASET -m MODEL -l LABELBIN [-p PLOT] train.py: error: the following arguments are required: -d/–dataset, -m/–model, -l/–labelbin An exception has occurred, use %tb to see the full traceback. SystemExit: 2

How can I fix this error to run my script appropriately and pass the arguments in spyder?

Advertisement

Answer

You can parse arguments by doing a special run from the settings and putting in the order that the arguments are expected.

Advertisement