0

How can I run this?

    ap = argparse.ArgumentParser()
ap.add_argument("-p", "--shape-predictor", required=True,
    help="path to facial landmark predictor")
ap.add_argument("-a", "--alarm", type=str, default="",
    help="path alarm .WAV file")
ap.add_argument("-w", "--webcam", type=int, default=0,
    help="index of webcam on system")
args = vars(ap.parse_args())

While I run this on Spyder it gives

   usage: [-h] -p SHAPE_PREDICTOR [-a ALARM] [-w WEBCAM]
: error: the following arguments are required: -p/--shape-predictor
An exception has occurred, use %tb to see the full traceback.

How can I solve this issue?

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

From @hiroprotagonist's comment posted above:

In spyder ctrl+F6 should allow you to pass command-line args when you execute your script. see here https://stackoverflow.com/a/26766414/4954037.

AlexK
  • 2,855
  • 9
  • 16
  • 27
  • If you are going to post someone else's comment as your own answer, please make sure to cite and link to that original comment. – AlexK Oct 25 '22 at 21:12