What does the -m option stand for in python?

Viewed 3292
2 Answers

in section 1.1.1 It clearly says -m is the module name, here.

Quoting from the docs :

"since the argument is a module name, you must not give a file extension (.py). The module-name should be a valid Python module name"

Although -m is arbitrary as in the backend It is an argparser doing all the work.

When called with -m module-name, the given module is located on the Python module path and executed as a script

Package names are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute <pkg>.__main__ And I guess the main also starting with 'm' is a coincidence.

It runs the module following -m. See the official documentation

The documentation says -m <module-name>, as well as "Since the argument is a module name...", so it makes sense to assume that "m" stands for module.

Related