Basic usage of argparse

Setting up the argparse already has some (little) added value.

import argparse

parser = argparse.ArgumentParser()

print('the code...')

Running the script without any parameter will not interfere...

$ python
the code...

If the user tries to pass some parameters on the command line, the argparse will print an error message and stop the execution.

$ python foo
usage: [-h] error: unrecognized arguments: foo

$ python -h
usage: [-h]

optional arguments:
  -h, --help  show this help message and exit

The minimal set up of the argparse class already provides a (minimally) useful help message.