As per official Python document, optparse module is deprecated and they have stopped the development for this module.
There are various advantages that argparse have over optparse some of them are:
1. It is a flexible and powerful library for command-line parsing .
2. It allows prefixes like ‘+’ etc.
3. Handles positional arguments
4. It allows sub-commands
5. It has a much simpler interface for custom types and action.
You can get more details about argparse here:https://www.python.org/dev/peps/pep-0389/