PEP 338 – Executing modules as scripts
https://peps.python.org/pep-0338/
Abstract
This PEP defines semantics for executing any Python module as a script, either with the -m command line switch, or by invoking it via runpy.run_module(modulename).
python -m
The -m switch implemented in Python 2.4 is quite limited. This PEP proposes making use of the PEP 302 import hooks to allow any module which provides access to its code object to be executed.
PEP 302 – New Import Hooks
Python 2.4 adds the command line switch -m to allow modules to be located using the Python module namespace for execution as scripts.