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文件中應該一行一個參數,想改變行爲參考
相關文章
相關標籤/搜索