【发布时间】:2013-01-24 09:46:49
【问题描述】:
我的 python3 脚本适用于命令行上指定的输入和输出文件。 用法应该是这样的
xxxx.py [-h] --input=file --output=file
在我正在使用的代码中
parser.add_argument("input", help='Input file');
parser.add_argument("output", help='Output file');
但参数没有必要的前缀。有没有办法为每个参数指定前缀?
【问题讨论】:
标签: python python-3.x argparse