我试图使用Python检查模块的参数参数:argparse没有得到触发
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Example with non-optional arguments')
parser.add_argument('count', action="store", type=int)
parser.add_argument('units', action="store")
print 'test'
当我运行该脚本(python test.py some inches
),它只是打印输出'test'
但模块不被触发。
哦,对于......你实际上从来没有'parse_args'! – jonrsharpe