Last active
December 27, 2019 07:36
-
-
Save nanmi/417dbc307f58f63756ea6761221a1eaf to your computer and use it in GitHub Desktop.
在命令行即可运行的--arguments的参数选项设置方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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