python中的argparse(转载)

# -*- coding: utf-8 -*- import argparse args = "-f hello.txt -n 1 2 3 -x 100 -y b -z a -q hello @args.txt i_am_bar -h".split() # 使用@args.txt要求fromfile_prefix_chars="@" # args.txt文件中应该一行一个参数,想改变行为参考
相关文章
相关标签/搜索