在Jupyter Notebook中将命令行参数与Python一起使用

时间:2020-03-14 12:35:56

标签: python command-line jupyter-notebook

我需要掌握这些代码行背后的概念。这真让我感到困惑。我使用Jupyter Notebook运行代码,但收到错误标志:

ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", help = "path to the image file")
ap.add_argument("-c", "--coords",
help = "comma separated list of source points")
args = vars(ap.parse_args())

错误消息:

usage: ipykernel_launcher.py [-h] [-i IMAGE] [-c COORDS]
ipykernel_launcher.py: error: unrecognized arguments: -f C:\Users\bamidele\AppData\Roaming\jupyter\runtime\kernel-720c660a-a69a-48d8-9b23-40bf4a604168.json

0 个答案:

没有答案
相关问题