📜  argparse 示例 python pyimagesearch - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:45.806000             🧑  作者: Mango

代码示例1
# import the necessary packages
import argparse
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-n", "--name", required=True,
    help="name of the user")
args = vars(ap.parse_args())
# display a friendly message to the user
print("Hi there {}, it's nice to meet you!".format(args["name"]))