I have a Python script with a docstring. When the parsing of the command-line arguments does not succeed, I want to print the docstring for the user\'s information.
The docstring is stored in the module's __doc__ global.
__doc__
print(__doc__)
By the way, this goes for any module: import sys; print(sys.__doc__). Docstrings of functions and classes are also in their __doc__ attribute.
import sys; print(sys.__doc__)