Python argparse Module

argparse module handles argument parsement out of global variable sys.argv. It can also generate help and error messages if the user gives invalid arguments. argparse module located at "Lib/".

Let's see a file named "" with code:

import argparse
ps = argparse.ArgumentParser()
ps.add_argument('--elements',help='strings to be concatenated')
args = ps.parse_args()
Run the file from command line:
C:\> python --help
usage: [-h] [--elements ELEMENTS]
optional arguments:
-h, --help show this help message and exit
--elements ELEMENTS strings to be concatenated