Meaning of python -m flag
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5 Looping
--
Chapters
00:00 Meaning Of Python -M Flag
00:18 Accepted Answer Score 22
00:36 Answer 2 Score 20
00:52 Answer 3 Score 47
01:28 Answer 4 Score 19
01:41 Thank you
--
Full question
https://stackoverflow.com/questions/5082...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #python3x #pip
#avk47
ANSWER 1
Score 47
From Python Docs:
Since the argument is a module name, you must not give a file extension (.py). The
module-nameshould be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to use a name that includes a hyphen).Package names are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute
<pkg>.__main__as the main module. This behaviour is deliberately similar to the handling of directories and zipfiles that are passed to the interpreter as the script argument.
ACCEPTED ANSWER
Score 22
If you type python --help
You get
// More flags above
-m mod : run library module as a script (terminates option list)
// and more flags below
A great many things in a terminal will show you how to use it if you either use command --help or man command
ANSWER 3
Score 20
The -m stands for module-name.
From Command line and environment:
python [-bBdEhiIOqsSuvVWx?] [-c command | -m module-name | script | - ] [args]
ANSWER 4
Score 19
When -m is used with a python statement on the command line, followed by a <module_name>, then it enables the module to be executed as an executable file.
You can refer to python docs for the same, or run python --help