test.py
import argparse
parser = argparse.ArgumentParser(description='Example with non-optional arguments')
parser.add_argument('count', action="store", type=int)
parser.add_argument('units', action="store")
print(parser.parse_args())
python3 test.py 3 i
Namespace(count=3, units='i')
參數數量及類型錯一個都不行,必修參數