Skip to content

Instantly share code, notes, and snippets.

@nanmi
Last active December 27, 2019 07:36
Show Gist options
  • Save nanmi/417dbc307f58f63756ea6761221a1eaf to your computer and use it in GitHub Desktop.
Save nanmi/417dbc307f58f63756ea6761221a1eaf to your computer and use it in GitHub Desktop.
在命令行即可运行的--arguments的参数选项设置方法
import argparse
def get_args():
parser = argparse.ArgumentParser(description='整个参数列表的自定义名称')
parser.add_argument('--{argument参数提示符}',type={int/str...数据输入类型},default={默认数据},help='{命令提示内容}':q)
return parser.parse_args()
args = get_args()
args.{argument参数提示符}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment