how to install pip from python code example

Example 1: installing pip

python -m pip install --upgrade pip

Example 2: python pip install

## To install Pip, first download get-pip.py from:
https://bootstrap.pypa.io/get-pip.py
  
## Then run the following command in the command line
## in the folder where the file has been saved.
python get-pip.py

Example 3: install pip

python -m pip download [options] <requirement specifier> [package-index-options] ...
python -m pip download [options] -r <requirements file> [package-index-options] ...
python -m pip download [options] <vcs project url> ...
python -m pip download [options] <local project path> ...
python -m pip download [options] <archive url/path> ...