title: How to parse arguments in python (spyder)?
body: <p>I am following <a href="https://www.pyimagesearch.com/2018/04/16/keras-and-convolutional-neural-networks-cnns/" rel="nofollow noreferrer">this</a> tutorial and trying to run the below part of the script. I am using python 3.7 and spyder 3.3.4. </p>
  
  <pre><code>ap = argparse.ArgumentParser()
  ap.add_argument("-d", "--dataset", required=True,
      help="path to input dataset (i.e., directory of images)")
  ap.add_argument("-m", "--model", required=True,
      help="path to output model")
  ap.add_argument("-l", "--labelbin", required=True,
      help="path to output label binarizer")
  ap.add_argument("-p", "--plot", type=str, default="plot.png",
      help="path to output accuracy/loss plot")
  args = vars(ap.parse_args())
  </code></pre>
  
  <p>I have tried going to Run > Configuration per file and entering the arguments as advised by <a href="https://stackoverflow.com/questions/26679272/how-to-use-argv-with-spyder">this post and</a> and <a href="https://stackoverflow.com/questions/53768365/how-to-execute-with-optional-argument-in-spyder">this post</a>.</p>
  
  <blockquote>
    <p>command line options: <em>path1</em>, <em>path2</em>, <em>path3</em>, <em>path4</em></p>
  </blockquote>
  
  <p>I filled out the appropriate paths for the arguments above and then ran the script, but go the error below.</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>How can I fix this error to run my script appropriately and pass the arguments in spyder?</p>