明明很简单的,害的老子搞了两个多小时?
parser.add_argument("params", default=None, type=None, dest='params', help='need to be implement') after args=parser.parse_args() is used, send a string params to args.params, the format is like: "{'key':value,'key2':"string"}" then use the code below make the string change to a dict, the apply to the args.params dict_value = eval(args.params) args.params = dict_value