import argparse
parse = argparse.ArgumentParser()
parse.set_defaults()
##添加参数
parse.add_argument("-u","--url",help="eg. http://www.baidu.com")
parse.add_argument("-o","--out",help="the file whitch save the output")
##解析参数
args = parse.parse_args()
##检测是否存在参数 -u/--url
if "url" in args:
print(args.url)