Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of python -m flag

What does -m in python -m pip install <package> mean ? or while upgrading pip using python -m pip install --upgrade pip.

like image 914
Koustav Chanda Avatar asked Jun 12 '18 15:06

Koustav Chanda


People also ask

What is flag variable in Python?

Flag variables are the same for all languages, whether it's RUBY, Python, Javascript or C++. A flag variable is usually given one value, 0 or 1 , True or False . It's used as a Boolean variable where the result toggles between 0 (False) and 1 (True) or as used by the programmer.

What does mean Python?

It returns mean of the data set passed as parameters. Arithmetic mean is the sum of data divided by the number of data-points. It is a measure of the central location of data in a set of values which vary in range. In Python, we usually do this by dividing the sum of given numbers with the count of number present.

What is flag in programming?

In programming, a flag is a predefined bit or bit sequence that holds a binary value. Typically, a program uses a flag to remember something or to leave a sign for another program.


1 Answers

From Python 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, 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.

like image 159
tourist Avatar answered Sep 20 '22 14:09

tourist