我試圖使用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